/* steam-configuration-service.c generated by valac 0.56.19, the Vala compiler
 * generated from steam-configuration-service.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 <gee.h>
#include <errno.h>
#include <gio/gio.h>

#define PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT "\u001eprotonplus-absent"
#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_SERVICES_STEAM_CONFIGURATION_MUTATION_0_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ACCEPTED_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR (proton_plus_services_default_steam_shortcut_mutator_get_type ())
#define PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR, ProtonPlusServicesDefaultSteamShortcutMutator))
#define PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR, ProtonPlusServicesDefaultSteamShortcutMutatorClass))
#define PROTON_PLUS_SERVICES_IS_DEFAULT_STEAM_SHORTCUT_MUTATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR))
#define PROTON_PLUS_SERVICES_IS_DEFAULT_STEAM_SHORTCUT_MUTATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR))
#define PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR, ProtonPlusServicesDefaultSteamShortcutMutatorClass))

typedef struct _ProtonPlusServicesDefaultSteamShortcutMutator ProtonPlusServicesDefaultSteamShortcutMutator;
typedef struct _ProtonPlusServicesDefaultSteamShortcutMutatorClass ProtonPlusServicesDefaultSteamShortcutMutatorClass;
typedef struct _ProtonPlusServicesDefaultSteamShortcutMutatorPrivate ProtonPlusServicesDefaultSteamShortcutMutatorPrivate;
enum  {
	PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR_0_PROPERTY,
	PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_default_steam_shortcut_mutator_properties[PROTON_PLUS_SERVICES_DEFAULT_STEAM_SHORTCUT_MUTATOR_NUM_PROPERTIES];
enum  {
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_0_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_steam_configuration_service_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _proton_plus_utils_vdf_binary_unref0(var) ((var == NULL) ? NULL : (var = (proton_plus_utils_vdf_binary_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData;
typedef struct _ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData;

struct _ProtonPlusServicesSteamConfigurationMutationPrivate {
	ProtonPlusServicesSteamConfigurationMutationResult _result;
	gchar* _error;
};

struct _ProtonPlusServicesDefaultSteamShortcutMutator {
	GObject parent_instance;
	ProtonPlusServicesDefaultSteamShortcutMutatorPrivate * priv;
};

struct _ProtonPlusServicesDefaultSteamShortcutMutatorClass {
	GObjectClass parent_class;
};

struct _ProtonPlusServicesSteamConfigurationServicePrivate {
	ProtonPlusServicesSteamSessionService* sessions;
	ProtonPlusServicesSteamRestartManager* manager;
	ProtonPlusServicesSteamShortcutMutator* shortcut_mutator;
};

struct _ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamConfigurationService* self;
	ProtonPlusModelsSteamProfile* profile;
	ProtonPlusServicesSteamConfigurationMutation* result;
	ProtonPlusServicesSteamConfigurationMutation* _tmp0_;
};

struct _ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamConfigurationService* self;
	ProtonPlusModelsSteamProfile* profile;
	ProtonPlusServicesSteamConfigurationMutation* result;
	ProtonPlusServicesSteamConfigurationMutation* _tmp0_;
};

static gint ProtonPlusServicesSteamConfigurationMutation_private_offset;
static gpointer proton_plus_services_steam_configuration_mutation_parent_class = NULL;
static gpointer proton_plus_services_default_steam_shortcut_mutator_parent_class = NULL;
static ProtonPlusServicesSteamShortcutMutatorIface * proton_plus_services_default_steam_shortcut_mutator_proton_plus_services_steam_shortcut_mutator_parent_iface = NULL;
static gint ProtonPlusServicesSteamConfigurationService_private_offset;
static gpointer proton_plus_services_steam_configuration_service_parent_class = NULL;
static ProtonPlusServicesSteamConfigurationService* proton_plus_services_steam_configuration_service_configured;
static ProtonPlusServicesSteamConfigurationService* proton_plus_services_steam_configuration_service_configured = NULL;
static ProtonPlusServicesSteamConfigurationReconcilerIface * proton_plus_services_steam_configuration_service_proton_plus_services_steam_configuration_reconciler_parent_iface = NULL;

static void proton_plus_services_steam_configuration_mutation_set_result (ProtonPlusServicesSteamConfigurationMutation* self,
                                                                   ProtonPlusServicesSteamConfigurationMutationResult value);
static void proton_plus_services_steam_configuration_mutation_set_error (ProtonPlusServicesSteamConfigurationMutation* self,
                                                                  const gchar* value);
static void proton_plus_services_steam_configuration_mutation_finalize (GObject * obj);
static GType proton_plus_services_steam_configuration_mutation_get_type_once (void);
static void _vala_proton_plus_services_steam_configuration_mutation_get_property (GObject * object,
                                                                           guint property_id,
                                                                           GValue * value,
                                                                           GParamSpec * pspec);
static void _vala_proton_plus_services_steam_configuration_mutation_set_property (GObject * object,
                                                                           guint property_id,
                                                                           const GValue * value,
                                                                           GParamSpec * pspec);
static GType proton_plus_services_steam_configuration_reconciler_get_type_once (void);
static GType proton_plus_services_steam_shortcut_mutator_get_type_once (void);
VALA_EXTERN GType proton_plus_services_default_steam_shortcut_mutator_get_type (void) G_GNUC_CONST ;
static gboolean proton_plus_services_default_steam_shortcut_mutator_real_install (ProtonPlusServicesSteamShortcutMutator* base,
                                                                           ProtonPlusUtilsVDFShortcuts* shortcuts);
static gboolean proton_plus_services_default_steam_shortcut_mutator_real_remove (ProtonPlusServicesSteamShortcutMutator* base,
                                                                          ProtonPlusUtilsVDFShortcuts* shortcuts);
VALA_EXTERN ProtonPlusServicesDefaultSteamShortcutMutator* proton_plus_services_default_steam_shortcut_mutator_new (void);
VALA_EXTERN ProtonPlusServicesDefaultSteamShortcutMutator* proton_plus_services_default_steam_shortcut_mutator_construct (GType object_type);
static GType proton_plus_services_default_steam_shortcut_mutator_get_type_once (void);
static ProtonPlusServicesSteamConfigurationMutation* proton_plus_services_steam_configuration_service_change_compatibility_mapping (ProtonPlusServicesSteamConfigurationService* self,
                                                                                                                             ProtonPlusModelsLaunchersSteam* steam,
                                                                                                                             guint appid,
                                                                                                                             const gchar* value,
                                                                                                                             ProtonPlusModelsSteamChangeKind kind);
static ProtonPlusServicesSteamConfigurationMutation* proton_plus_services_steam_configuration_service_submit (ProtonPlusServicesSteamConfigurationService* self,
                                                                                                       ProtonPlusModelsSteamRestartTarget* target,
                                                                                                       ProtonPlusModelsSteamChangeKind kind,
                                                                                                       const gchar* key,
                                                                                                       ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                                                       const gchar* content);
static gchar* proton_plus_services_steam_configuration_service_launch_value (ProtonPlusServicesSteamConfigurationService* self,
                                                                      const gchar* content,
                                                                      guint appid);
static void proton_plus_services_steam_configuration_service_install_protonplus_shortcut_data_free (gpointer _data);
static gboolean proton_plus_services_steam_configuration_service_install_protonplus_shortcut_co (ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData* _data_);
static ProtonPlusServicesSteamConfigurationMutation* proton_plus_services_steam_configuration_service_change_protonplus_shortcut (ProtonPlusServicesSteamConfigurationService* self,
                                                                                                                           ProtonPlusModelsSteamProfile* profile,
                                                                                                                           gboolean desired_present);
static void proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_data_free (gpointer _data);
static gboolean proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_co (ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData* _data_);
static ProtonPlusServicesSteamConfigurationMutation* proton_plus_services_steam_configuration_service_record_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                                                              ProtonPlusModelsSteamRestartTarget* target,
                                                                                                              ProtonPlusModelsSteamChangeKind kind,
                                                                                                              const gchar* key,
                                                                                                              ProtonPlusModelsSteamConfigurationIntent* intent);
static gchar* proton_plus_services_steam_configuration_service_compatibility_value (ProtonPlusServicesSteamConfigurationService* self,
                                                                             const gchar* content,
                                                                             guint appid);
static gboolean proton_plus_services_steam_configuration_service_same_desired (ProtonPlusServicesSteamConfigurationService* self,
                                                                        ProtonPlusModelsSteamConfigurationIntent* first,
                                                                        ProtonPlusModelsSteamConfigurationIntent* second);
static gboolean proton_plus_services_steam_configuration_service_apply_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                        ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                        const gchar* content,
                                                                        gboolean write);
static ProtonPlusServicesSteamConfigurationMutation* proton_plus_services_steam_configuration_service_real_reconcile_target (ProtonPlusServicesSteamConfigurationReconciler* base,
                                                                                                                      ProtonPlusModelsSteamRestartTarget* target);
static gboolean proton_plus_services_steam_configuration_service_apply_pending_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                                ProtonPlusModelsSteamConfigurationIntent* intent);
static gchar* proton_plus_services_steam_configuration_service_value_for_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                          ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                          const gchar* content);
static gboolean proton_plus_services_steam_configuration_service_matches_desired (ProtonPlusServicesSteamConfigurationService* self,
                                                                           ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                           const gchar* value);
static gboolean proton_plus_services_steam_configuration_service_matches_baseline (ProtonPlusServicesSteamConfigurationService* self,
                                                                            ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                            const gchar* value);
static gboolean proton_plus_services_steam_configuration_service_real_verify_target_after_session (ProtonPlusServicesSteamConfigurationReconciler* base,
                                                                                            ProtonPlusModelsSteamRestartTarget* target);
static gchar* proton_plus_services_steam_configuration_service_mutate_compatibility (ProtonPlusServicesSteamConfigurationService* self,
                                                                              const gchar* content,
                                                                              guint appid,
                                                                              const gchar* desired,
                                                                              gboolean desired_present);
static gchar* proton_plus_services_steam_configuration_service_mutate_launch (ProtonPlusServicesSteamConfigurationService* self,
                                                                       const gchar* content,
                                                                       guint appid,
                                                                       const gchar* desired,
                                                                       gboolean desired_present);
static void proton_plus_services_steam_configuration_service_finalize (GObject * obj);
static GType proton_plus_services_steam_configuration_service_get_type_once (void);
static void _vala_proton_plus_services_steam_configuration_service_get_property (GObject * object,
                                                                          guint property_id,
                                                                          GValue * value,
                                                                          GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static GType
proton_plus_services_steam_configuration_mutation_result_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED", "failed"}, {PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED", "unchanged"}, {PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED", "changed"}, {PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED", "staged"}, {PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PERSISTENCE_FAILED, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PERSISTENCE_FAILED", "persistence-failed"}, {PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CONFLICT, "PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CONFLICT", "conflict"}, {0, NULL, NULL}};
	GType proton_plus_services_steam_configuration_mutation_result_type_id;
	proton_plus_services_steam_configuration_mutation_result_type_id = g_enum_register_static ("ProtonPlusServicesSteamConfigurationMutationResult", values);
	return proton_plus_services_steam_configuration_mutation_result_type_id;
}

GType
proton_plus_services_steam_configuration_mutation_result_get_type (void)
{
	static volatile gsize proton_plus_services_steam_configuration_mutation_result_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_configuration_mutation_result_type_id__once)) {
		GType proton_plus_services_steam_configuration_mutation_result_type_id;
		proton_plus_services_steam_configuration_mutation_result_type_id = proton_plus_services_steam_configuration_mutation_result_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_configuration_mutation_result_type_id__once, proton_plus_services_steam_configuration_mutation_result_type_id);
	}
	return proton_plus_services_steam_configuration_mutation_result_type_id__once;
}

static inline gpointer
proton_plus_services_steam_configuration_mutation_get_instance_private (ProtonPlusServicesSteamConfigurationMutation* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesSteamConfigurationMutation_private_offset);
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_mutation_construct (GType object_type,
                                                             ProtonPlusServicesSteamConfigurationMutationResult _result_,
                                                             const gchar* _error_)
{
	ProtonPlusServicesSteamConfigurationMutation * self = NULL;
	self = (ProtonPlusServicesSteamConfigurationMutation*) g_object_new (object_type, NULL);
	proton_plus_services_steam_configuration_mutation_set_result (self, _result_);
	proton_plus_services_steam_configuration_mutation_set_error (self, _error_);
	return self;
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_mutation_new (ProtonPlusServicesSteamConfigurationMutationResult _result_,
                                                       const gchar* _error_)
{
	return proton_plus_services_steam_configuration_mutation_construct (PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_MUTATION, _result_, _error_);
}

ProtonPlusServicesSteamConfigurationMutationResult
proton_plus_services_steam_configuration_mutation_get_result (ProtonPlusServicesSteamConfigurationMutation* self)
{
	ProtonPlusServicesSteamConfigurationMutationResult result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_result;
	return result;
}

static void
proton_plus_services_steam_configuration_mutation_set_result (ProtonPlusServicesSteamConfigurationMutation* self,
                                                              ProtonPlusServicesSteamConfigurationMutationResult value)
{
	ProtonPlusServicesSteamConfigurationMutationResult old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_steam_configuration_mutation_get_result (self);
	if (old_value != value) {
		self->priv->_result = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY]);
	}
}

const gchar*
proton_plus_services_steam_configuration_mutation_get_error (ProtonPlusServicesSteamConfigurationMutation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_error;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_steam_configuration_mutation_set_error (ProtonPlusServicesSteamConfigurationMutation* self,
                                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_steam_configuration_mutation_get_error (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_error);
		self->priv->_error = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY]);
	}
}

gboolean
proton_plus_services_steam_configuration_mutation_get_accepted (ProtonPlusServicesSteamConfigurationMutation* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = self->priv->_result;
	if (_tmp2_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED) {
		_tmp1_ = TRUE;
	} else {
		ProtonPlusServicesSteamConfigurationMutationResult _tmp3_;
		_tmp3_ = self->priv->_result;
		_tmp1_ = _tmp3_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesSteamConfigurationMutationResult _tmp4_;
		_tmp4_ = self->priv->_result;
		_tmp0_ = _tmp4_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED;
	}
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_steam_configuration_mutation_class_init (ProtonPlusServicesSteamConfigurationMutationClass * klass,
                                                              gpointer klass_data)
{
	proton_plus_services_steam_configuration_mutation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesSteamConfigurationMutation_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_services_steam_configuration_mutation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_services_steam_configuration_mutation_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_steam_configuration_mutation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY, proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY] = g_param_spec_enum ("result", "result", "result", PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_MUTATION_RESULT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY, proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY] = g_param_spec_string ("error", "error", "error", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ACCEPTED_PROPERTY, proton_plus_services_steam_configuration_mutation_properties[PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ACCEPTED_PROPERTY] = g_param_spec_boolean ("accepted", "accepted", "accepted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_services_steam_configuration_mutation_instance_init (ProtonPlusServicesSteamConfigurationMutation * self,
                                                                 gpointer klass)
{
	self->priv = proton_plus_services_steam_configuration_mutation_get_instance_private (self);
}

static void
proton_plus_services_steam_configuration_mutation_finalize (GObject * obj)
{
	ProtonPlusServicesSteamConfigurationMutation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_MUTATION, ProtonPlusServicesSteamConfigurationMutation);
	_g_free0 (self->priv->_error);
	G_OBJECT_CLASS (proton_plus_services_steam_configuration_mutation_parent_class)->finalize (obj);
}

static GType
proton_plus_services_steam_configuration_mutation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesSteamConfigurationMutationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_steam_configuration_mutation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesSteamConfigurationMutation), 0, (GInstanceInitFunc) proton_plus_services_steam_configuration_mutation_instance_init, NULL };
	GType proton_plus_services_steam_configuration_mutation_type_id;
	proton_plus_services_steam_configuration_mutation_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesSteamConfigurationMutation", &g_define_type_info, 0);
	ProtonPlusServicesSteamConfigurationMutation_private_offset = g_type_add_instance_private (proton_plus_services_steam_configuration_mutation_type_id, sizeof (ProtonPlusServicesSteamConfigurationMutationPrivate));
	return proton_plus_services_steam_configuration_mutation_type_id;
}

GType
proton_plus_services_steam_configuration_mutation_get_type (void)
{
	static volatile gsize proton_plus_services_steam_configuration_mutation_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_configuration_mutation_type_id__once)) {
		GType proton_plus_services_steam_configuration_mutation_type_id;
		proton_plus_services_steam_configuration_mutation_type_id = proton_plus_services_steam_configuration_mutation_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_configuration_mutation_type_id__once, proton_plus_services_steam_configuration_mutation_type_id);
	}
	return proton_plus_services_steam_configuration_mutation_type_id__once;
}

static void
_vala_proton_plus_services_steam_configuration_mutation_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusServicesSteamConfigurationMutation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_MUTATION, ProtonPlusServicesSteamConfigurationMutation);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY:
		g_value_set_enum (value, proton_plus_services_steam_configuration_mutation_get_result (self));
		break;
		case PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY:
		g_value_set_string (value, proton_plus_services_steam_configuration_mutation_get_error (self));
		break;
		case PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ACCEPTED_PROPERTY:
		g_value_set_boolean (value, proton_plus_services_steam_configuration_mutation_get_accepted (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_services_steam_configuration_mutation_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusServicesSteamConfigurationMutation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_MUTATION, ProtonPlusServicesSteamConfigurationMutation);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PROPERTY:
		proton_plus_services_steam_configuration_mutation_set_result (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_ERROR_PROPERTY:
		proton_plus_services_steam_configuration_mutation_set_error (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_reconciler_reconcile_target (ProtonPlusServicesSteamConfigurationReconciler* self,
                                                                      ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusServicesSteamConfigurationReconcilerIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_RECONCILER_GET_INTERFACE (self);
	if (_iface_->reconcile_target) {
		return _iface_->reconcile_target (self, target);
	}
	return NULL;
}

gboolean
proton_plus_services_steam_configuration_reconciler_verify_target_after_session (ProtonPlusServicesSteamConfigurationReconciler* self,
                                                                                 ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusServicesSteamConfigurationReconcilerIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_RECONCILER_GET_INTERFACE (self);
	if (_iface_->verify_target_after_session) {
		return _iface_->verify_target_after_session (self, target);
	}
	return FALSE;
}

static void
proton_plus_services_steam_configuration_reconciler_default_init (ProtonPlusServicesSteamConfigurationReconcilerIface * iface,
                                                                  gpointer iface_data)
{
}

static GType
proton_plus_services_steam_configuration_reconciler_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesSteamConfigurationReconcilerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_steam_configuration_reconciler_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_services_steam_configuration_reconciler_type_id;
	proton_plus_services_steam_configuration_reconciler_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusServicesSteamConfigurationReconciler", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_services_steam_configuration_reconciler_type_id, G_TYPE_OBJECT);
	return proton_plus_services_steam_configuration_reconciler_type_id;
}

GType
proton_plus_services_steam_configuration_reconciler_get_type (void)
{
	static volatile gsize proton_plus_services_steam_configuration_reconciler_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_configuration_reconciler_type_id__once)) {
		GType proton_plus_services_steam_configuration_reconciler_type_id;
		proton_plus_services_steam_configuration_reconciler_type_id = proton_plus_services_steam_configuration_reconciler_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_configuration_reconciler_type_id__once, proton_plus_services_steam_configuration_reconciler_type_id);
	}
	return proton_plus_services_steam_configuration_reconciler_type_id__once;
}

gboolean
proton_plus_services_steam_shortcut_mutator_install (ProtonPlusServicesSteamShortcutMutator* self,
                                                     ProtonPlusUtilsVDFShortcuts* shortcuts)
{
	ProtonPlusServicesSteamShortcutMutatorIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_SERVICES_STEAM_SHORTCUT_MUTATOR_GET_INTERFACE (self);
	if (_iface_->install) {
		return _iface_->install (self, shortcuts);
	}
	return FALSE;
}

gboolean
proton_plus_services_steam_shortcut_mutator_remove (ProtonPlusServicesSteamShortcutMutator* self,
                                                    ProtonPlusUtilsVDFShortcuts* shortcuts)
{
	ProtonPlusServicesSteamShortcutMutatorIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_SERVICES_STEAM_SHORTCUT_MUTATOR_GET_INTERFACE (self);
	if (_iface_->remove) {
		return _iface_->remove (self, shortcuts);
	}
	return FALSE;
}

static void
proton_plus_services_steam_shortcut_mutator_default_init (ProtonPlusServicesSteamShortcutMutatorIface * iface,
                                                          gpointer iface_data)
{
}

static GType
proton_plus_services_steam_shortcut_mutator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesSteamShortcutMutatorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_steam_shortcut_mutator_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_services_steam_shortcut_mutator_type_id;
	proton_plus_services_steam_shortcut_mutator_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusServicesSteamShortcutMutator", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_services_steam_shortcut_mutator_type_id, G_TYPE_OBJECT);
	return proton_plus_services_steam_shortcut_mutator_type_id;
}

GType
proton_plus_services_steam_shortcut_mutator_get_type (void)
{
	static volatile gsize proton_plus_services_steam_shortcut_mutator_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_shortcut_mutator_type_id__once)) {
		GType proton_plus_services_steam_shortcut_mutator_type_id;
		proton_plus_services_steam_shortcut_mutator_type_id = proton_plus_services_steam_shortcut_mutator_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_shortcut_mutator_type_id__once, proton_plus_services_steam_shortcut_mutator_type_id);
	}
	return proton_plus_services_steam_shortcut_mutator_type_id__once;
}

static gboolean
proton_plus_services_default_steam_shortcut_mutator_real_install (ProtonPlusServicesSteamShortcutMutator* base,
                                                                  ProtonPlusUtilsVDFShortcuts* shortcuts)
{
	ProtonPlusServicesDefaultSteamShortcutMutator * self;
	gboolean result;
	self = (ProtonPlusServicesDefaultSteamShortcutMutator*) base;
	g_return_val_if_fail (shortcuts != NULL, FALSE);
	result = proton_plus_utils_vdf_shortcuts_install_for_current_environment (shortcuts);
	return result;
}

static gboolean
proton_plus_services_default_steam_shortcut_mutator_real_remove (ProtonPlusServicesSteamShortcutMutator* base,
                                                                 ProtonPlusUtilsVDFShortcuts* shortcuts)
{
	ProtonPlusServicesDefaultSteamShortcutMutator * self;
	gboolean result;
	self = (ProtonPlusServicesDefaultSteamShortcutMutator*) base;
	g_return_val_if_fail (shortcuts != NULL, FALSE);
	result = proton_plus_utils_vdf_shortcuts_uninstall (shortcuts);
	return result;
}

ProtonPlusServicesDefaultSteamShortcutMutator*
proton_plus_services_default_steam_shortcut_mutator_construct (GType object_type)
{
	ProtonPlusServicesDefaultSteamShortcutMutator * self = NULL;
	self = (ProtonPlusServicesDefaultSteamShortcutMutator*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusServicesDefaultSteamShortcutMutator*
proton_plus_services_default_steam_shortcut_mutator_new (void)
{
	return proton_plus_services_default_steam_shortcut_mutator_construct (PROTON_PLUS_SERVICES_TYPE_DEFAULT_STEAM_SHORTCUT_MUTATOR);
}

static void
proton_plus_services_default_steam_shortcut_mutator_class_init (ProtonPlusServicesDefaultSteamShortcutMutatorClass * klass,
                                                                gpointer klass_data)
{
	proton_plus_services_default_steam_shortcut_mutator_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_services_default_steam_shortcut_mutator_proton_plus_services_steam_shortcut_mutator_interface_init (ProtonPlusServicesSteamShortcutMutatorIface * iface,
                                                                                                                gpointer iface_data)
{
	proton_plus_services_default_steam_shortcut_mutator_proton_plus_services_steam_shortcut_mutator_parent_iface = g_type_interface_peek_parent (iface);
	iface->install = (gboolean (*) (ProtonPlusServicesSteamShortcutMutator*, ProtonPlusUtilsVDFShortcuts*)) proton_plus_services_default_steam_shortcut_mutator_real_install;
	iface->remove = (gboolean (*) (ProtonPlusServicesSteamShortcutMutator*, ProtonPlusUtilsVDFShortcuts*)) proton_plus_services_default_steam_shortcut_mutator_real_remove;
}

static void
proton_plus_services_default_steam_shortcut_mutator_instance_init (ProtonPlusServicesDefaultSteamShortcutMutator * self,
                                                                   gpointer klass)
{
}

static GType
proton_plus_services_default_steam_shortcut_mutator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesDefaultSteamShortcutMutatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_default_steam_shortcut_mutator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesDefaultSteamShortcutMutator), 0, (GInstanceInitFunc) proton_plus_services_default_steam_shortcut_mutator_instance_init, NULL };
	static const GInterfaceInfo proton_plus_services_steam_shortcut_mutator_info = { (GInterfaceInitFunc) proton_plus_services_default_steam_shortcut_mutator_proton_plus_services_steam_shortcut_mutator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_services_default_steam_shortcut_mutator_type_id;
	proton_plus_services_default_steam_shortcut_mutator_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesDefaultSteamShortcutMutator", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_services_default_steam_shortcut_mutator_type_id, PROTON_PLUS_SERVICES_TYPE_STEAM_SHORTCUT_MUTATOR, &proton_plus_services_steam_shortcut_mutator_info);
	return proton_plus_services_default_steam_shortcut_mutator_type_id;
}

GType
proton_plus_services_default_steam_shortcut_mutator_get_type (void)
{
	static volatile gsize proton_plus_services_default_steam_shortcut_mutator_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_default_steam_shortcut_mutator_type_id__once)) {
		GType proton_plus_services_default_steam_shortcut_mutator_type_id;
		proton_plus_services_default_steam_shortcut_mutator_type_id = proton_plus_services_default_steam_shortcut_mutator_get_type_once ();
		g_once_init_leave (&proton_plus_services_default_steam_shortcut_mutator_type_id__once, proton_plus_services_default_steam_shortcut_mutator_type_id);
	}
	return proton_plus_services_default_steam_shortcut_mutator_type_id__once;
}

static inline gpointer
proton_plus_services_steam_configuration_service_get_instance_private (ProtonPlusServicesSteamConfigurationService* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesSteamConfigurationService_private_offset);
}

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

ProtonPlusServicesSteamConfigurationService*
proton_plus_services_steam_configuration_service_construct (GType object_type,
                                                            ProtonPlusServicesSteamSessionService* sessions,
                                                            ProtonPlusServicesSteamRestartManager* manager,
                                                            ProtonPlusServicesSteamShortcutMutator* shortcut_mutator)
{
	ProtonPlusServicesSteamConfigurationService * self = NULL;
	ProtonPlusServicesSteamSessionService* _tmp0_;
	ProtonPlusServicesSteamRestartManager* _tmp1_;
	ProtonPlusServicesSteamShortcutMutator* _tmp2_ = NULL;
	ProtonPlusServicesSteamShortcutMutator* _tmp3_;
	ProtonPlusServicesSteamShortcutMutator* _tmp5_;
	g_return_val_if_fail (sessions != NULL, NULL);
	g_return_val_if_fail (manager != NULL, NULL);
	self = (ProtonPlusServicesSteamConfigurationService*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (sessions);
	_g_object_unref0 (self->priv->sessions);
	self->priv->sessions = _tmp0_;
	_tmp1_ = _g_object_ref0 (manager);
	_g_object_unref0 (self->priv->manager);
	self->priv->manager = _tmp1_;
	_tmp3_ = _g_object_ref0 (shortcut_mutator);
	_tmp2_ = _tmp3_;
	if (_tmp2_ == NULL) {
		ProtonPlusServicesDefaultSteamShortcutMutator* _tmp4_;
		_tmp4_ = proton_plus_services_default_steam_shortcut_mutator_new ();
		_g_object_unref0 (_tmp2_);
		_tmp2_ = (ProtonPlusServicesSteamShortcutMutator*) _tmp4_;
	}
	_tmp5_ = _tmp2_;
	_tmp2_ = NULL;
	_g_object_unref0 (self->priv->shortcut_mutator);
	self->priv->shortcut_mutator = _tmp5_;
	_g_object_unref0 (_tmp2_);
	return self;
}

ProtonPlusServicesSteamConfigurationService*
proton_plus_services_steam_configuration_service_new (ProtonPlusServicesSteamSessionService* sessions,
                                                      ProtonPlusServicesSteamRestartManager* manager,
                                                      ProtonPlusServicesSteamShortcutMutator* shortcut_mutator)
{
	return proton_plus_services_steam_configuration_service_construct (PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, sessions, manager, shortcut_mutator);
}

void
proton_plus_services_steam_configuration_service_configure (ProtonPlusServicesSteamConfigurationService* service)
{
	ProtonPlusServicesSteamConfigurationService* _tmp0_;
	g_return_if_fail (service != NULL);
	_tmp0_ = _g_object_ref0 (service);
	_g_object_unref0 (proton_plus_services_steam_configuration_service_configured);
	proton_plus_services_steam_configuration_service_configured = _tmp0_;
}

void
proton_plus_services_steam_configuration_service_reset_configuration (void)
{
	_g_object_unref0 (proton_plus_services_steam_configuration_service_configured);
	proton_plus_services_steam_configuration_service_configured = NULL;
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_change_default_compatibility_tool (ProtonPlusServicesSteamConfigurationService* self,
                                                                                    ProtonPlusModelsLaunchersSteam* steam,
                                                                                    const gchar* value)
{
	ProtonPlusServicesSteamConfigurationMutation* _tmp0_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (steam != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = proton_plus_services_steam_configuration_service_change_compatibility_mapping (self, steam, (guint) 0, value, PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_DEFAULT_COMPATIBILITY_TOOL_CHANGED);
	result = _tmp0_;
	return result;
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_change_game_compatibility_tool (ProtonPlusServicesSteamConfigurationService* self,
                                                                                 ProtonPlusModelsGamesSteam* game,
                                                                                 const gchar* value)
{
	ProtonPlusModelsLauncher* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp4_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (game != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = proton_plus_models_game_get_launcher ((ProtonPlusModelsGame*) game);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_games_steam_get_appid (game);
	_tmp3_ = _tmp2_;
	_tmp4_ = proton_plus_services_steam_configuration_service_change_compatibility_mapping (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam), _tmp3_, value, PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_GAME_COMPATIBILITY_TOOL_CHANGED);
	result = _tmp4_;
	return result;
}

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

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_change_game_launch_options (ProtonPlusServicesSteamConfigurationService* self,
                                                                             ProtonPlusModelsGamesSteam* game,
                                                                             const gchar* value,
                                                                             const gchar* localconfig_path)
{
	ProtonPlusModelsLaunchersSteam* launcher = NULL;
	ProtonPlusModelsLauncher* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	ProtonPlusModelsLaunchersSteam* _tmp2_;
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp3_;
	ProtonPlusModelsSteamRestartTarget* _tmp4_;
	ProtonPlusModelsSteamRestartTarget* _tmp5_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gchar* content = NULL;
	gchar* _tmp55_;
	gchar* current = NULL;
	const gchar* _tmp56_;
	guint _tmp57_;
	guint _tmp58_;
	gchar* _tmp59_;
	const gchar* _tmp60_;
	ProtonPlusModelsSteamRestartTarget* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	guint _tmp65_;
	guint _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
	gchar* _tmp72_;
	guint _tmp73_;
	guint _tmp74_;
	gchar* _tmp75_;
	gchar* _tmp76_;
	const gchar* _tmp77_;
	const gchar* _tmp78_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp79_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp80_;
	const gchar* _tmp81_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp82_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp83_;
	GError* _inner_error0_ = NULL;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (game != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	g_return_val_if_fail (localconfig_path != NULL, NULL);
	_tmp0_ = proton_plus_models_game_get_launcher ((ProtonPlusModelsGame*) game);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam));
	launcher = _tmp2_;
	_tmp3_ = launcher;
	_tmp4_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) _tmp3_);
	target = _tmp4_;
	_tmp5_ = target;
	if (_tmp5_ == NULL) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp6_;
		_tmp6_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "No Steam target.");
		result = _tmp6_;
		_g_object_unref0 (target);
		_g_object_unref0 (launcher);
		return result;
	}
	_tmp7_ = proton_plus_models_games_steam_get_is_non_steam (game);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		ProtonPlusModelsLaunchersSteam* _tmp9_;
		ProtonPlusModelsSteamProfile* _tmp10_;
		ProtonPlusModelsSteamProfile* _tmp11_;
		gchar* path = NULL;
		ProtonPlusModelsLaunchersSteam* _tmp13_;
		ProtonPlusModelsSteamProfile* _tmp14_;
		ProtonPlusModelsSteamProfile* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp9_ = launcher;
		_tmp10_ = proton_plus_models_launchers_steam_get_profile (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_ == NULL) {
			ProtonPlusServicesSteamConfigurationMutation* _tmp12_;
			_tmp12_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "No Steam profile.");
			result = _tmp12_;
			_g_object_unref0 (target);
			_g_object_unref0 (launcher);
			return result;
		}
		_tmp13_ = launcher;
		_tmp14_ = proton_plus_models_launchers_steam_get_profile (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = proton_plus_models_steam_profile_get_userdata_path (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_build_filename (_tmp17_, "config", "shortcuts.vdf", NULL);
		path = _tmp18_;
		_tmp19_ = path;
		if (!g_file_test (_tmp19_, G_FILE_TEST_IS_REGULAR)) {
			ProtonPlusServicesSteamConfigurationMutation* _tmp20_;
			_tmp20_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "shortcuts.vdf is missing.");
			result = _tmp20_;
			_g_free0 (path);
			_g_object_unref0 (target);
			_g_object_unref0 (launcher);
			return result;
		}
		{
			ProtonPlusUtilsVDFShortcuts* shortcuts = NULL;
			const gchar* _tmp21_;
			ProtonPlusUtilsVDFShortcuts* _tmp22_;
			ProtonPlusUtilsVDFShortcut shortcut = {0};
			ProtonPlusUtilsVDFShortcuts* _tmp23_;
			guint _tmp24_;
			guint _tmp25_;
			ProtonPlusUtilsVDFShortcut _tmp26_ = {0};
			ProtonPlusUtilsVDFShortcut _tmp27_;
			const gchar* _tmp28_;
			ProtonPlusModelsSteamRestartTarget* _tmp30_;
			const gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			guint _tmp34_;
			guint _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			guint _tmp41_;
			guint _tmp42_;
			gchar* _tmp43_;
			gchar* _tmp44_;
			ProtonPlusUtilsVDFShortcut _tmp45_;
			const gchar* _tmp46_;
			gchar* _tmp47_;
			gchar* _tmp48_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp49_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp50_;
			ProtonPlusServicesSteamConfigurationMutation* _tmp51_;
			ProtonPlusServicesSteamConfigurationMutation* _tmp52_;
			_tmp21_ = path;
			_tmp22_ = proton_plus_utils_vdf_shortcuts_load (_tmp21_, &_inner_error0_);
			shortcuts = _tmp22_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp23_ = shortcuts;
			_tmp24_ = proton_plus_models_games_steam_get_appid (game);
			_tmp25_ = _tmp24_;
			proton_plus_utils_vdf_shortcuts_get_shortcut_by_appid (_tmp23_, _tmp25_, &_tmp26_);
			shortcut = _tmp26_;
			_tmp27_ = shortcut;
			_tmp28_ = _tmp27_.AppName;
			if (_tmp28_ == NULL) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp29_;
				_tmp29_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Shortcut was not found.");
				result = _tmp29_;
				proton_plus_utils_vdf_shortcut_destroy (&shortcut);
				_proton_plus_utils_vdf_binary_unref0 (shortcuts);
				_g_free0 (path);
				_g_object_unref0 (target);
				_g_object_unref0 (launcher);
				return result;
			}
			_tmp30_ = target;
			_tmp31_ = path;
			_tmp32_ = g_canonicalize_filename (_tmp31_, NULL);
			_tmp33_ = _tmp32_;
			_tmp34_ = proton_plus_models_games_steam_get_appid (game);
			_tmp35_ = _tmp34_;
			_tmp36_ = g_strdup_printf ("%s#shortcut/%u/LaunchOptions", _tmp33_, _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = path;
			_tmp39_ = g_canonicalize_filename (_tmp38_, NULL);
			_tmp40_ = _tmp39_;
			_tmp41_ = proton_plus_models_games_steam_get_appid (game);
			_tmp42_ = _tmp41_;
			_tmp43_ = g_strdup_printf ("%u", _tmp42_);
			_tmp44_ = _tmp43_;
			_tmp45_ = shortcut;
			_tmp46_ = _tmp45_.LaunchOptions;
			_tmp47_ = string_replace (value, "\"", "\\\"");
			_tmp48_ = _tmp47_;
			_tmp49_ = proton_plus_models_steam_configuration_intent_new (PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_SHORTCUTS, PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_LAUNCH_OPTIONS, _tmp40_, _tmp44_, _tmp46_, _tmp48_, TRUE, TRUE, NULL);
			_tmp50_ = _tmp49_;
			_tmp51_ = proton_plus_services_steam_configuration_service_submit (self, _tmp30_, PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_NON_STEAM_GAME_LAUNCH_OPTIONS_CHANGED, _tmp37_, _tmp50_, "");
			_tmp52_ = _tmp51_;
			_g_object_unref0 (_tmp50_);
			_g_free0 (_tmp48_);
			_g_free0 (_tmp44_);
			_g_free0 (_tmp40_);
			_g_free0 (_tmp37_);
			_g_free0 (_tmp33_);
			result = _tmp52_;
			proton_plus_utils_vdf_shortcut_destroy (&shortcut);
			_proton_plus_utils_vdf_binary_unref0 (shortcuts);
			_g_free0 (path);
			_g_object_unref0 (target);
			_g_object_unref0 (launcher);
			return result;
		}
		goto __finally0;
		__catch0_g_error:
		{
			ProtonPlusServicesSteamConfigurationMutation* _tmp53_;
			g_clear_error (&_inner_error0_);
			_tmp53_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "shortcuts.vdf could not be parsed.");
			result = _tmp53_;
			_g_free0 (path);
			_g_object_unref0 (target);
			_g_object_unref0 (launcher);
			return result;
		}
		__finally0:
		_g_free0 (path);
		_g_object_unref0 (target);
		_g_object_unref0 (launcher);
		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 (!g_file_test (localconfig_path, G_FILE_TEST_IS_REGULAR)) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp54_;
		_tmp54_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "localconfig.vdf is missing.");
		result = _tmp54_;
		_g_object_unref0 (target);
		_g_object_unref0 (launcher);
		return result;
	}
	_tmp55_ = proton_plus_utils_filesystem_get_file_content (localconfig_path, FALSE);
	content = _tmp55_;
	_tmp56_ = content;
	_tmp57_ = proton_plus_models_games_steam_get_appid (game);
	_tmp58_ = _tmp57_;
	_tmp59_ = proton_plus_services_steam_configuration_service_launch_value (self, _tmp56_, _tmp58_);
	current = _tmp59_;
	_tmp60_ = current;
	if (_tmp60_ == NULL) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp61_;
		_tmp61_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Malformed localconfig.vdf.");
		result = _tmp61_;
		_g_free0 (current);
		_g_free0 (content);
		_g_object_unref0 (target);
		_g_object_unref0 (launcher);
		return result;
	}
	_tmp62_ = target;
	_tmp63_ = g_canonicalize_filename (localconfig_path, NULL);
	_tmp64_ = _tmp63_;
	_tmp65_ = proton_plus_models_games_steam_get_appid (game);
	_tmp66_ = _tmp65_;
	_tmp67_ = g_strdup_printf ("%u", _tmp66_);
	_tmp68_ = _tmp67_;
	_tmp69_ = g_strdup_printf ("%s#%s/LaunchOptions", _tmp64_, _tmp68_);
	_tmp70_ = _tmp69_;
	_tmp71_ = g_canonicalize_filename (localconfig_path, NULL);
	_tmp72_ = _tmp71_;
	_tmp73_ = proton_plus_models_games_steam_get_appid (game);
	_tmp74_ = _tmp73_;
	_tmp75_ = g_strdup_printf ("%u", _tmp74_);
	_tmp76_ = _tmp75_;
	_tmp77_ = current;
	_tmp78_ = current;
	_tmp79_ = proton_plus_models_steam_configuration_intent_new (PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_LOCALCONFIG, PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_LAUNCH_OPTIONS, _tmp72_, _tmp76_, (const gchar*) _tmp77_, value, g_strcmp0 (_tmp78_, PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT) != 0, g_strcmp0 (value, "") != 0, NULL);
	_tmp80_ = _tmp79_;
	_tmp81_ = content;
	_tmp82_ = proton_plus_services_steam_configuration_service_submit (self, _tmp62_, PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_STEAM_GAME_LAUNCH_OPTIONS_CHANGED, _tmp70_, _tmp80_, _tmp81_);
	_tmp83_ = _tmp82_;
	_g_object_unref0 (_tmp80_);
	_g_free0 (_tmp76_);
	_g_free0 (_tmp72_);
	_g_free0 (_tmp70_);
	_g_free0 (_tmp68_);
	_g_free0 (_tmp64_);
	result = _tmp83_;
	_g_free0 (current);
	_g_free0 (content);
	_g_object_unref0 (target);
	_g_object_unref0 (launcher);
	return result;
}

gboolean
proton_plus_services_steam_configuration_service_protonplus_shortcut_is_effectively_installed (ProtonPlusServicesSteamConfigurationService* self,
                                                                                               ProtonPlusModelsSteamProfile* profile)
{
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	ProtonPlusModelsLaunchersSteam* _tmp1_;
	ProtonPlusModelsSteamRestartTarget* _tmp2_;
	ProtonPlusModelsSteamRestartTarget* _tmp3_;
	gchar* path = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp15_;
	ProtonPlusModelsSteamRestartTarget* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp20_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp21_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp22_;
	gboolean _tmp26_ = FALSE;
	ProtonPlusUtilsVDFShortcuts* _tmp27_;
	ProtonPlusUtilsVDFShortcuts* _tmp28_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (profile != NULL, FALSE);
	_tmp0_ = proton_plus_models_steam_profile_get_launcher (profile);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) _tmp1_);
	target = _tmp2_;
	_tmp3_ = target;
	if (_tmp3_ == NULL) {
		gboolean _tmp4_ = FALSE;
		ProtonPlusUtilsVDFShortcuts* _tmp5_;
		ProtonPlusUtilsVDFShortcuts* _tmp6_;
		_tmp5_ = proton_plus_models_steam_profile_get_shortcuts (profile);
		_tmp6_ = _tmp5_;
		if (_tmp6_ != NULL) {
			ProtonPlusUtilsVDFShortcuts* _tmp7_;
			ProtonPlusUtilsVDFShortcuts* _tmp8_;
			_tmp7_ = proton_plus_models_steam_profile_get_shortcuts (profile);
			_tmp8_ = _tmp7_;
			_tmp4_ = proton_plus_utils_vdf_shortcuts_get_installed_status (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_UTILS_VDF_TYPE_SHORTCUTS, ProtonPlusUtilsVDFShortcuts));
		} else {
			_tmp4_ = FALSE;
		}
		result = _tmp4_;
		_g_object_unref0 (target);
		return result;
	}
	_tmp9_ = proton_plus_models_steam_profile_get_userdata_path (profile);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_build_filename (_tmp10_, "config", "shortcuts.vdf", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_canonicalize_filename (_tmp12_, NULL);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	path = _tmp14_;
	_tmp15_ = self->priv->manager;
	_tmp16_ = target;
	_tmp17_ = path;
	_tmp18_ = g_strdup_printf ("%s#ProtonPlus", _tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = proton_plus_services_steam_restart_manager_get_pending_configuration_intent (_tmp15_, _tmp16_, _tmp19_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp19_);
	intent = _tmp21_;
	_tmp22_ = intent;
	if (_tmp22_ != NULL) {
		ProtonPlusModelsSteamConfigurationIntent* _tmp23_;
		gboolean _tmp24_;
		gboolean _tmp25_;
		_tmp23_ = intent;
		_tmp24_ = proton_plus_models_steam_configuration_intent_get_desired_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
		_tmp25_ = _tmp24_;
		result = _tmp25_;
		_g_object_unref0 (intent);
		_g_free0 (path);
		_g_object_unref0 (target);
		return result;
	}
	_tmp27_ = proton_plus_models_steam_profile_get_shortcuts (profile);
	_tmp28_ = _tmp27_;
	if (_tmp28_ != NULL) {
		ProtonPlusUtilsVDFShortcuts* _tmp29_;
		ProtonPlusUtilsVDFShortcuts* _tmp30_;
		_tmp29_ = proton_plus_models_steam_profile_get_shortcuts (profile);
		_tmp30_ = _tmp29_;
		_tmp26_ = proton_plus_utils_vdf_shortcuts_get_installed_status (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, PROTON_PLUS_UTILS_VDF_TYPE_SHORTCUTS, ProtonPlusUtilsVDFShortcuts));
	} else {
		_tmp26_ = FALSE;
	}
	result = _tmp26_;
	_g_object_unref0 (intent);
	_g_free0 (path);
	_g_object_unref0 (target);
	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;
	}
}

void
proton_plus_services_steam_configuration_service_overlay_launcher_effective_state (ProtonPlusServicesSteamConfigurationService* self,
                                                                                   ProtonPlusModelsLaunchersSteam* launcher)
{
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsSteamRestartTarget* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusModelsSteamRestartTarget* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_tmp0_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) launcher);
	target = _tmp0_;
	_tmp2_ = target;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		GHashTable* _tmp3_;
		_tmp3_ = launcher->compatibility_tool_hashtable;
		_tmp1_ = _tmp3_ == NULL;
	}
	if (_tmp1_) {
		_g_object_unref0 (target);
		return;
	}
	{
		GeeList* _record_list = NULL;
		ProtonPlusServicesSteamRestartManager* _tmp4_;
		ProtonPlusModelsSteamRestartTarget* _tmp5_;
		GeeList* _tmp6_;
		gint _record_size = 0;
		GeeList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _record_index = 0;
		_tmp4_ = self->priv->manager;
		_tmp5_ = target;
		_tmp6_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp4_, _tmp5_);
		_record_list = _tmp6_;
		_tmp7_ = _record_list;
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_record_size = _tmp9_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp12_;
			gpointer _tmp13_;
			ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp14_;
			ProtonPlusModelsSteamChangeReceipt* _tmp15_;
			ProtonPlusModelsSteamChangeReceipt* _tmp16_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp17_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp18_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp19_;
			gboolean _tmp20_ = FALSE;
			ProtonPlusModelsSteamConfigurationIntent* _tmp21_;
			guint appid = 0U;
			ProtonPlusModelsSteamConfigurationIntent* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			guint _tmp28_ = 0U;
			gboolean _tmp29_;
			const gchar* _tmp30_ = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp31_;
			gboolean _tmp32_;
			gboolean _tmp33_;
			gchar* value = NULL;
			gchar* _tmp38_;
			GList* _tmp44_;
			_record_index = _record_index + 1;
			_tmp10_ = _record_index;
			_tmp11_ = _record_size;
			if (!(_tmp10_ < _tmp11_)) {
				break;
			}
			_tmp12_ = _record_list;
			_tmp13_ = gee_list_get (_tmp12_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp13_;
			_tmp14_ = record;
			_tmp15_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = _g_object_ref0 (_tmp18_);
			intent = _tmp19_;
			_tmp21_ = intent;
			if (_tmp21_ == NULL) {
				_tmp20_ = TRUE;
			} else {
				ProtonPlusModelsSteamConfigurationIntent* _tmp22_;
				ProtonPlusModelsSteamConfigurationOperation _tmp23_;
				ProtonPlusModelsSteamConfigurationOperation _tmp24_;
				_tmp22_ = intent;
				_tmp23_ = proton_plus_models_steam_configuration_intent_get_operation (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp24_ = _tmp23_;
				_tmp20_ = _tmp24_ != PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_COMPATIBILITY_MAPPING;
			}
			if (_tmp20_) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp25_ = intent;
			_tmp26_ = proton_plus_models_steam_configuration_intent_get_field_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp27_ = _tmp26_;
			_tmp29_ = uint_try_parse (_tmp27_, &_tmp28_, NULL, (guint) 0);
			appid = _tmp28_;
			if (!_tmp29_) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp31_ = intent;
			_tmp32_ = proton_plus_models_steam_configuration_intent_get_desired_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp33_ = _tmp32_;
			if (_tmp33_) {
				ProtonPlusModelsSteamConfigurationIntent* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				_tmp34_ = intent;
				_tmp35_ = proton_plus_models_steam_configuration_intent_get_desired (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp36_ = _tmp35_;
				_tmp30_ = _tmp36_;
			} else {
				const gchar* _tmp37_ = NULL;
				if (appid == ((guint) 0)) {
					_tmp37_ = "proton_experimental";
				} else {
					_tmp37_ = "Default";
				}
				_tmp30_ = _tmp37_;
			}
			_tmp38_ = g_strdup (_tmp30_);
			value = _tmp38_;
			if (appid == ((guint) 0)) {
				GHashTable* _tmp39_;
				const gchar* _tmp40_;
				gchar* _tmp41_;
				const gchar* _tmp42_;
				_tmp39_ = launcher->compatibility_tool_hashtable;
				_tmp40_ = value;
				_tmp41_ = g_strdup (_tmp40_);
				g_hash_table_insert (_tmp39_, (gpointer) ((guintptr) appid), _tmp41_);
				_tmp42_ = value;
				proton_plus_models_launchers_steam_set_default_compatibility_tool (launcher, _tmp42_);
			} else {
				const gchar* _tmp43_;
				_tmp43_ = value;
				proton_plus_models_launchers_steam_update_game_compatibility_tool_mapping (launcher, appid, _tmp43_);
			}
			_tmp44_ = ((ProtonPlusModelsLauncher*) launcher)->games;
			{
				GList* game_collection = NULL;
				GList* game_it = NULL;
				game_collection = (GList*) _tmp44_;
				for (game_it = game_collection; game_it != NULL; game_it = game_it->next) {
					ProtonPlusModelsGamesSteam* _tmp45_;
					ProtonPlusModelsGamesSteam* game = NULL;
					_tmp45_ = _g_object_ref0 ((ProtonPlusModelsGamesSteam*) game_it->data);
					game = _tmp45_;
					{
						ProtonPlusModelsGamesSteam* _tmp46_;
						guint _tmp47_;
						guint _tmp48_;
						_tmp46_ = game;
						_tmp47_ = proton_plus_models_games_steam_get_appid (_tmp46_);
						_tmp48_ = _tmp47_;
						if (_tmp48_ == appid) {
							ProtonPlusModelsGamesSteam* _tmp49_;
							const gchar* _tmp50_;
							_tmp49_ = game;
							_tmp50_ = value;
							proton_plus_models_games_steam_apply_effective_compatibility_tool (_tmp49_, _tmp50_);
						}
						_g_object_unref0 (game);
					}
				}
			}
			_g_free0 (value);
			_g_object_unref0 (intent);
			_g_object_unref0 (record);
		}
		_g_object_unref0 (_record_list);
	}
	_g_object_unref0 (target);
}

void
proton_plus_services_steam_configuration_service_overlay_profile_effective_state (ProtonPlusServicesSteamConfigurationService* self,
                                                                                  ProtonPlusModelsSteamProfile* profile)
{
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	ProtonPlusModelsLaunchersSteam* _tmp1_;
	ProtonPlusModelsSteamRestartTarget* _tmp2_;
	gboolean _tmp3_ = FALSE;
	ProtonPlusModelsSteamRestartTarget* _tmp4_;
	gchar* localconfig = NULL;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* shortcuts = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (profile != NULL);
	_tmp0_ = proton_plus_models_steam_profile_get_launcher (profile);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) _tmp1_);
	target = _tmp2_;
	_tmp4_ = target;
	if (_tmp4_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		GHashTable* _tmp5_;
		_tmp5_ = profile->launch_options_hashtable;
		_tmp3_ = _tmp5_ == NULL;
	}
	if (_tmp3_) {
		_g_object_unref0 (target);
		return;
	}
	_tmp6_ = proton_plus_models_steam_profile_get_localconfig_path (profile);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_canonicalize_filename (_tmp7_, NULL);
	localconfig = _tmp8_;
	_tmp9_ = proton_plus_models_steam_profile_get_userdata_path (profile);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_build_filename (_tmp10_, "config", "shortcuts.vdf", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_canonicalize_filename (_tmp12_, NULL);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	shortcuts = _tmp14_;
	{
		GeeList* _record_list = NULL;
		ProtonPlusServicesSteamRestartManager* _tmp15_;
		ProtonPlusModelsSteamRestartTarget* _tmp16_;
		GeeList* _tmp17_;
		gint _record_size = 0;
		GeeList* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
		gint _record_index = 0;
		_tmp15_ = self->priv->manager;
		_tmp16_ = target;
		_tmp17_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp15_, _tmp16_);
		_record_list = _tmp17_;
		_tmp18_ = _record_list;
		_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
		_tmp20_ = _tmp19_;
		_record_size = _tmp20_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp21_;
			gint _tmp22_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp23_;
			gpointer _tmp24_;
			ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp25_;
			ProtonPlusModelsSteamChangeReceipt* _tmp26_;
			ProtonPlusModelsSteamChangeReceipt* _tmp27_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp28_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp29_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp30_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp31_;
			guint appid = 0U;
			ProtonPlusModelsSteamConfigurationIntent* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			guint _tmp35_ = 0U;
			gboolean _tmp36_;
			const gchar* _tmp37_ = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp38_;
			gboolean _tmp39_;
			gboolean _tmp40_;
			gchar* value = NULL;
			gchar* _tmp44_;
			gboolean _tmp45_ = FALSE;
			ProtonPlusModelsSteamConfigurationIntent* _tmp46_;
			const gchar* _tmp47_;
			const gchar* _tmp48_;
			const gchar* _tmp49_;
			_record_index = _record_index + 1;
			_tmp21_ = _record_index;
			_tmp22_ = _record_size;
			if (!(_tmp21_ < _tmp22_)) {
				break;
			}
			_tmp23_ = _record_list;
			_tmp24_ = gee_list_get (_tmp23_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp24_;
			_tmp25_ = record;
			_tmp26_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = _g_object_ref0 (_tmp29_);
			intent = _tmp30_;
			_tmp31_ = intent;
			if (_tmp31_ == NULL) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp32_ = intent;
			_tmp33_ = proton_plus_models_steam_configuration_intent_get_field_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp34_ = _tmp33_;
			_tmp36_ = uint_try_parse (_tmp34_, &_tmp35_, NULL, (guint) 0);
			appid = _tmp35_;
			if (!_tmp36_) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp38_ = intent;
			_tmp39_ = proton_plus_models_steam_configuration_intent_get_desired_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp40_ = _tmp39_;
			if (_tmp40_) {
				ProtonPlusModelsSteamConfigurationIntent* _tmp41_;
				const gchar* _tmp42_;
				const gchar* _tmp43_;
				_tmp41_ = intent;
				_tmp42_ = proton_plus_models_steam_configuration_intent_get_desired (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp43_ = _tmp42_;
				_tmp37_ = _tmp43_;
			} else {
				_tmp37_ = "";
			}
			_tmp44_ = g_strdup (_tmp37_);
			value = _tmp44_;
			_tmp46_ = intent;
			_tmp47_ = proton_plus_models_steam_configuration_intent_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp48_ = _tmp47_;
			_tmp49_ = localconfig;
			if (g_strcmp0 (_tmp48_, _tmp49_) == 0) {
				ProtonPlusModelsSteamConfigurationIntent* _tmp50_;
				ProtonPlusModelsSteamConfigurationOperation _tmp51_;
				ProtonPlusModelsSteamConfigurationOperation _tmp52_;
				_tmp50_ = intent;
				_tmp51_ = proton_plus_models_steam_configuration_intent_get_operation (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp52_ = _tmp51_;
				_tmp45_ = _tmp52_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_LAUNCH_OPTIONS;
			} else {
				_tmp45_ = FALSE;
			}
			if (_tmp45_) {
				GHashTable* _tmp53_;
				const gchar* _tmp54_;
				gchar* _tmp55_;
				ProtonPlusModelsLaunchersSteam* _tmp56_;
				ProtonPlusModelsLaunchersSteam* _tmp57_;
				GList* _tmp58_;
				_tmp53_ = profile->launch_options_hashtable;
				_tmp54_ = value;
				_tmp55_ = g_strdup (_tmp54_);
				g_hash_table_insert (_tmp53_, (gpointer) ((guintptr) appid), _tmp55_);
				_tmp56_ = proton_plus_models_steam_profile_get_launcher (profile);
				_tmp57_ = _tmp56_;
				_tmp58_ = ((ProtonPlusModelsLauncher*) _tmp57_)->games;
				{
					GList* game_collection = NULL;
					GList* game_it = NULL;
					game_collection = (GList*) _tmp58_;
					for (game_it = game_collection; game_it != NULL; game_it = game_it->next) {
						ProtonPlusModelsGamesSteam* _tmp59_;
						ProtonPlusModelsGamesSteam* game = NULL;
						_tmp59_ = _g_object_ref0 ((ProtonPlusModelsGamesSteam*) game_it->data);
						game = _tmp59_;
						{
							ProtonPlusModelsGamesSteam* _tmp60_;
							guint _tmp61_;
							guint _tmp62_;
							_tmp60_ = game;
							_tmp61_ = proton_plus_models_games_steam_get_appid (_tmp60_);
							_tmp62_ = _tmp61_;
							if (_tmp62_ == appid) {
								ProtonPlusModelsGamesSteam* _tmp63_;
								const gchar* _tmp64_;
								_tmp63_ = game;
								_tmp64_ = value;
								proton_plus_models_games_steam_set_launch_options (_tmp63_, _tmp64_);
							}
							_g_object_unref0 (game);
						}
					}
				}
			} else {
				gboolean _tmp65_ = FALSE;
				gboolean _tmp66_ = FALSE;
				ProtonPlusModelsSteamConfigurationIntent* _tmp67_;
				const gchar* _tmp68_;
				const gchar* _tmp69_;
				const gchar* _tmp70_;
				_tmp67_ = intent;
				_tmp68_ = proton_plus_models_steam_configuration_intent_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp69_ = _tmp68_;
				_tmp70_ = shortcuts;
				if (g_strcmp0 (_tmp69_, _tmp70_) == 0) {
					ProtonPlusModelsSteamConfigurationIntent* _tmp71_;
					ProtonPlusModelsSteamConfigurationOperation _tmp72_;
					ProtonPlusModelsSteamConfigurationOperation _tmp73_;
					_tmp71_ = intent;
					_tmp72_ = proton_plus_models_steam_configuration_intent_get_operation (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
					_tmp73_ = _tmp72_;
					_tmp66_ = _tmp73_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_LAUNCH_OPTIONS;
				} else {
					_tmp66_ = FALSE;
				}
				if (_tmp66_) {
					GList* _tmp74_;
					_tmp74_ = profile->non_steam_games;
					_tmp65_ = _tmp74_ != NULL;
				} else {
					_tmp65_ = FALSE;
				}
				if (_tmp65_) {
					gchar* displayed = NULL;
					const gchar* _tmp75_;
					gchar* _tmp76_;
					GList* _tmp77_;
					_tmp75_ = value;
					_tmp76_ = string_replace (_tmp75_, "\\\"", "\"");
					displayed = _tmp76_;
					_tmp77_ = profile->non_steam_games;
					{
						GList* game_collection = NULL;
						GList* game_it = NULL;
						game_collection = _tmp77_;
						for (game_it = game_collection; game_it != NULL; game_it = game_it->next) {
							ProtonPlusModelsGamesSteam* _tmp78_;
							ProtonPlusModelsGamesSteam* game = NULL;
							_tmp78_ = _g_object_ref0 ((ProtonPlusModelsGamesSteam*) game_it->data);
							game = _tmp78_;
							{
								ProtonPlusModelsGamesSteam* _tmp79_;
								guint _tmp80_;
								guint _tmp81_;
								_tmp79_ = game;
								_tmp80_ = proton_plus_models_games_steam_get_appid (_tmp79_);
								_tmp81_ = _tmp80_;
								if (_tmp81_ == appid) {
									ProtonPlusModelsGamesSteam* _tmp82_;
									const gchar* _tmp83_;
									_tmp82_ = game;
									_tmp83_ = displayed;
									proton_plus_models_games_steam_set_launch_options (_tmp82_, _tmp83_);
								}
								_g_object_unref0 (game);
							}
						}
					}
					_g_free0 (displayed);
				}
			}
			_g_free0 (value);
			_g_object_unref0 (intent);
			_g_object_unref0 (record);
		}
		_g_object_unref0 (_record_list);
	}
	_g_free0 (shortcuts);
	_g_free0 (localconfig);
	_g_object_unref0 (target);
}

static void
proton_plus_services_steam_configuration_service_install_protonplus_shortcut_data_free (gpointer _data)
{
	ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->profile);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData, _data_);
}

void
proton_plus_services_steam_configuration_service_install_protonplus_shortcut (ProtonPlusServicesSteamConfigurationService* self,
                                                                              ProtonPlusModelsSteamProfile* profile,
                                                                              GAsyncReadyCallback _callback_,
                                                                              gpointer _user_data_)
{
	ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData* _data_;
	ProtonPlusServicesSteamConfigurationService* _tmp0_;
	ProtonPlusModelsSteamProfile* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (profile != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_configuration_service_install_protonplus_shortcut_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (profile);
	_g_object_unref0 (_data_->profile);
	_data_->profile = _tmp1_;
	proton_plus_services_steam_configuration_service_install_protonplus_shortcut_co (_data_);
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_install_protonplus_shortcut_finish (ProtonPlusServicesSteamConfigurationService* self,
                                                                                     GAsyncResult* _res_)
{
	ProtonPlusServicesSteamConfigurationMutation* result;
	ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_install_protonplus_shortcut_co (ProtonPlusServicesSteamConfigurationServiceInstallProtonplusShortcutData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_services_steam_configuration_service_change_protonplus_shortcut (_data_->self, _data_->profile, TRUE);
	_data_->result = _data_->_tmp0_;
	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_services_steam_configuration_service_remove_protonplus_shortcut_data_free (gpointer _data)
{
	ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->profile);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData, _data_);
}

void
proton_plus_services_steam_configuration_service_remove_protonplus_shortcut (ProtonPlusServicesSteamConfigurationService* self,
                                                                             ProtonPlusModelsSteamProfile* profile,
                                                                             GAsyncReadyCallback _callback_,
                                                                             gpointer _user_data_)
{
	ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData* _data_;
	ProtonPlusServicesSteamConfigurationService* _tmp0_;
	ProtonPlusModelsSteamProfile* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (profile != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (profile);
	_g_object_unref0 (_data_->profile);
	_data_->profile = _tmp1_;
	proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_co (_data_);
}

ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_finish (ProtonPlusServicesSteamConfigurationService* self,
                                                                                    GAsyncResult* _res_)
{
	ProtonPlusServicesSteamConfigurationMutation* result;
	ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_remove_protonplus_shortcut_co (ProtonPlusServicesSteamConfigurationServiceRemoveProtonplusShortcutData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_services_steam_configuration_service_change_protonplus_shortcut (_data_->self, _data_->profile, FALSE);
	_data_->result = _data_->_tmp0_;
	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 ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_change_protonplus_shortcut (ProtonPlusServicesSteamConfigurationService* self,
                                                                             ProtonPlusModelsSteamProfile* profile,
                                                                             gboolean desired_present)
{
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	ProtonPlusModelsLaunchersSteam* _tmp1_;
	ProtonPlusModelsSteamRestartTarget* _tmp2_;
	ProtonPlusModelsSteamRestartTarget* _tmp3_;
	gchar* path = NULL;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean _tmp11_ = FALSE;
	ProtonPlusUtilsVDFShortcuts* _tmp12_;
	ProtonPlusUtilsVDFShortcuts* _tmp13_;
	gboolean installed = FALSE;
	ProtonPlusModelsSteamConfigurationIntent* existing = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp16_;
	ProtonPlusModelsSteamRestartTarget* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp21_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp22_;
	gboolean _tmp23_ = FALSE;
	ProtonPlusModelsSteamConfigurationIntent* _tmp24_;
	gboolean _tmp29_ = FALSE;
	ProtonPlusModelsSteamConfigurationIntent* _tmp30_;
	ProtonPlusServicesSteamSessionSnapshot* snapshot = NULL;
	ProtonPlusServicesSteamSessionService* _tmp32_;
	ProtonPlusModelsSteamRestartTarget* _tmp33_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp34_;
	gboolean _tmp35_ = FALSE;
	ProtonPlusServicesSteamSessionSnapshot* _tmp36_;
	ProtonPlusServicesSteamSessionState _tmp37_;
	ProtonPlusServicesSteamSessionState _tmp38_;
	const gchar* _tmp58_ = NULL;
	const gchar* _tmp59_ = NULL;
	ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
	const gchar* _tmp60_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp61_;
	ProtonPlusModelsSteamChangeKind _tmp62_ = 0;
	ProtonPlusModelsSteamRestartTarget* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp67_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp68_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp69_;
	GError* _inner_error0_ = NULL;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (profile != NULL, NULL);
	_tmp0_ = proton_plus_models_steam_profile_get_launcher (profile);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) _tmp1_);
	target = _tmp2_;
	_tmp3_ = target;
	if (_tmp3_ == NULL) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp4_;
		_tmp4_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "No Steam target.");
		result = _tmp4_;
		_g_object_unref0 (target);
		return result;
	}
	_tmp5_ = proton_plus_models_steam_profile_get_userdata_path (profile);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_build_filename (_tmp6_, "config", "shortcuts.vdf", NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_canonicalize_filename (_tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	path = _tmp10_;
	_tmp12_ = proton_plus_models_steam_profile_get_shortcuts (profile);
	_tmp13_ = _tmp12_;
	if (_tmp13_ != NULL) {
		ProtonPlusUtilsVDFShortcuts* _tmp14_;
		ProtonPlusUtilsVDFShortcuts* _tmp15_;
		_tmp14_ = proton_plus_models_steam_profile_get_shortcuts (profile);
		_tmp15_ = _tmp14_;
		_tmp11_ = proton_plus_utils_vdf_shortcuts_get_installed_status (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_UTILS_VDF_TYPE_SHORTCUTS, ProtonPlusUtilsVDFShortcuts));
	} else {
		_tmp11_ = FALSE;
	}
	installed = _tmp11_;
	_tmp16_ = self->priv->manager;
	_tmp17_ = target;
	_tmp18_ = path;
	_tmp19_ = g_strdup_printf ("%s#ProtonPlus", _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = proton_plus_services_steam_restart_manager_get_pending_configuration_intent (_tmp16_, _tmp17_, _tmp20_);
	_tmp22_ = _tmp21_;
	_g_free0 (_tmp20_);
	existing = _tmp22_;
	_tmp24_ = existing;
	if (_tmp24_ != NULL) {
		ProtonPlusModelsSteamConfigurationIntent* _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp25_ = existing;
		_tmp26_ = proton_plus_models_steam_configuration_intent_get_desired_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
		_tmp27_ = _tmp26_;
		_tmp23_ = _tmp27_ == desired_present;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp28_;
		_tmp28_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp28_;
		_g_object_unref0 (existing);
		_g_free0 (path);
		_g_object_unref0 (target);
		return result;
	}
	_tmp30_ = existing;
	if (_tmp30_ == NULL) {
		_tmp29_ = installed == desired_present;
	} else {
		_tmp29_ = FALSE;
	}
	if (_tmp29_) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp31_;
		_tmp31_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp31_;
		_g_object_unref0 (existing);
		_g_free0 (path);
		_g_object_unref0 (target);
		return result;
	}
	_tmp32_ = self->priv->sessions;
	_tmp33_ = target;
	_tmp34_ = proton_plus_services_steam_session_service_inspect (_tmp32_, _tmp33_);
	snapshot = _tmp34_;
	_tmp36_ = snapshot;
	_tmp37_ = proton_plus_services_steam_session_snapshot_get_state (_tmp36_);
	_tmp38_ = _tmp37_;
	if (_tmp38_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STOPPED) {
		ProtonPlusServicesSteamSessionSnapshot* _tmp39_;
		ProtonPlusServicesSteamEvidenceLevel _tmp40_;
		ProtonPlusServicesSteamEvidenceLevel _tmp41_;
		_tmp39_ = snapshot;
		_tmp40_ = proton_plus_services_steam_session_snapshot_get_state_confidence (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp35_ = _tmp41_ == PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	} else {
		_tmp35_ = FALSE;
	}
	if (_tmp35_) {
		{
			ProtonPlusUtilsVDFShortcuts* _tmp42_ = NULL;
			const gchar* _tmp43_;
			ProtonPlusUtilsVDFShortcuts* shortcuts = NULL;
			ProtonPlusUtilsVDFShortcuts* _tmp48_;
			gboolean _tmp49_ = FALSE;
			gboolean changed = FALSE;
			ProtonPlusUtilsVDFShortcuts* _tmp55_;
			ProtonPlusServicesSteamConfigurationMutation* _tmp56_;
			_tmp43_ = path;
			if (g_file_test (_tmp43_, G_FILE_TEST_IS_REGULAR)) {
				const gchar* _tmp44_;
				ProtonPlusUtilsVDFShortcuts* _tmp45_;
				_tmp44_ = path;
				_tmp45_ = proton_plus_utils_vdf_shortcuts_load (_tmp44_, &_inner_error0_);
				_proton_plus_utils_vdf_binary_unref0 (_tmp42_);
				_tmp42_ = _tmp45_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_proton_plus_utils_vdf_binary_unref0 (_tmp42_);
					goto __catch0_g_error;
				}
			} else {
				const gchar* _tmp46_;
				ProtonPlusUtilsVDFShortcuts* _tmp47_;
				_tmp46_ = path;
				_tmp47_ = proton_plus_utils_vdf_shortcuts_empty (_tmp46_);
				_proton_plus_utils_vdf_binary_unref0 (_tmp42_);
				_tmp42_ = _tmp47_;
			}
			_tmp48_ = _tmp42_;
			_tmp42_ = NULL;
			shortcuts = _tmp48_;
			if (desired_present) {
				ProtonPlusServicesSteamShortcutMutator* _tmp50_;
				ProtonPlusUtilsVDFShortcuts* _tmp51_;
				_tmp50_ = self->priv->shortcut_mutator;
				_tmp51_ = shortcuts;
				_tmp49_ = proton_plus_services_steam_shortcut_mutator_install (_tmp50_, _tmp51_);
			} else {
				ProtonPlusServicesSteamShortcutMutator* _tmp52_;
				ProtonPlusUtilsVDFShortcuts* _tmp53_;
				_tmp52_ = self->priv->shortcut_mutator;
				_tmp53_ = shortcuts;
				_tmp49_ = proton_plus_services_steam_shortcut_mutator_remove (_tmp52_, _tmp53_);
			}
			changed = _tmp49_;
			if (!changed) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp54_;
				_tmp54_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Unable to change ProtonPlus shortcut.");
				result = _tmp54_;
				_proton_plus_utils_vdf_binary_unref0 (shortcuts);
				_proton_plus_utils_vdf_binary_unref0 (_tmp42_);
				_g_object_unref0 (snapshot);
				_g_object_unref0 (existing);
				_g_free0 (path);
				_g_object_unref0 (target);
				return result;
			}
			_tmp55_ = shortcuts;
			proton_plus_models_steam_profile_set_shortcuts (profile, _tmp55_);
			_tmp56_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED, NULL);
			result = _tmp56_;
			_proton_plus_utils_vdf_binary_unref0 (shortcuts);
			_proton_plus_utils_vdf_binary_unref0 (_tmp42_);
			_g_object_unref0 (snapshot);
			_g_object_unref0 (existing);
			_g_free0 (path);
			_g_object_unref0 (target);
			return result;
		}
		goto __finally0;
		__catch0_g_error:
		{
			ProtonPlusServicesSteamConfigurationMutation* _tmp57_;
			g_clear_error (&_inner_error0_);
			_tmp57_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Unable to change ProtonPlus shortcut.");
			result = _tmp57_;
			_g_object_unref0 (snapshot);
			_g_object_unref0 (existing);
			_g_free0 (path);
			_g_object_unref0 (target);
			return result;
		}
		__finally0:
		_g_object_unref0 (snapshot);
		_g_object_unref0 (existing);
		_g_free0 (path);
		_g_object_unref0 (target);
		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 (installed) {
		_tmp58_ = "present";
	} else {
		_tmp58_ = "";
	}
	if (desired_present) {
		_tmp59_ = "present";
	} else {
		_tmp59_ = "";
	}
	_tmp60_ = path;
	_tmp61_ = proton_plus_models_steam_configuration_intent_new (PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_SHORTCUTS, PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_PRESENCE, _tmp60_, "ProtonPlus", _tmp58_, _tmp59_, installed, desired_present, NULL);
	intent = _tmp61_;
	if (desired_present) {
		_tmp62_ = PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_PROTONPLUS_SHORTCUT_CREATED;
	} else {
		_tmp62_ = PROTON_PLUS_MODELS_STEAM_CHANGE_KIND_PROTONPLUS_SHORTCUT_REMOVED;
	}
	_tmp63_ = target;
	_tmp64_ = path;
	_tmp65_ = g_strdup_printf ("%s#ProtonPlus", _tmp64_);
	_tmp66_ = _tmp65_;
	_tmp67_ = intent;
	_tmp68_ = proton_plus_services_steam_configuration_service_record_intent (self, _tmp63_, _tmp62_, _tmp66_, _tmp67_);
	_tmp69_ = _tmp68_;
	_g_free0 (_tmp66_);
	result = _tmp69_;
	_g_object_unref0 (intent);
	_g_object_unref0 (snapshot);
	_g_object_unref0 (existing);
	_g_free0 (path);
	_g_object_unref0 (target);
	return result;
}

static ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_record_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                ProtonPlusModelsSteamRestartTarget* target,
                                                                ProtonPlusModelsSteamChangeKind kind,
                                                                const gchar* key,
                                                                ProtonPlusModelsSteamConfigurationIntent* intent)
{
	ProtonPlusServicesSteamRestartRecordResult _result_ = 0;
	ProtonPlusServicesSteamRestartManager* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	ProtonPlusModelsSteamChangeReceipt* _tmp3_;
	ProtonPlusModelsSteamChangeReceipt* _tmp4_;
	ProtonPlusServicesSteamRestartRecordResult _tmp5_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp11_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	g_return_val_if_fail (intent != NULL, NULL);
	_tmp0_ = self->priv->manager;
	_tmp1_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
	_tmp2_ = _tmp1_;
	_tmp3_ = proton_plus_models_steam_change_receipt_new (target, kind, PROTON_PLUS_MODELS_STEAM_RESTART_REQUIREMENT_CONSERVATIVE, key, _tmp2_, NULL, NULL, intent);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_services_steam_change_recorder_record ((ProtonPlusServicesSteamChangeRecorder*) _tmp0_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_result_ = _tmp5_;
	if (_result_ == PROTON_PLUS_SERVICES_STEAM_RESTART_RECORD_RESULT_PERSISTENCE_FAILED) {
		ProtonPlusServicesSteamRestartManager* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		ProtonPlusServicesSteamConfigurationMutation* _tmp9_;
		_tmp6_ = self->priv->manager;
		_tmp7_ = proton_plus_services_steam_restart_manager_get_last_persistence_error (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PERSISTENCE_FAILED, _tmp8_);
		result = _tmp9_;
		return result;
	}
	if (_result_ == PROTON_PLUS_SERVICES_STEAM_RESTART_RECORD_RESULT_REQUIREMENT_CLEARED) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp10_;
		_tmp10_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp10_;
		return result;
	}
	_tmp11_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED, NULL);
	result = _tmp11_;
	return result;
}

static ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_change_compatibility_mapping (ProtonPlusServicesSteamConfigurationService* self,
                                                                               ProtonPlusModelsLaunchersSteam* steam,
                                                                               guint appid,
                                                                               const gchar* value,
                                                                               ProtonPlusModelsSteamChangeKind kind)
{
	ProtonPlusModelsSteamRestartTarget* target = NULL;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	ProtonPlusModelsSteamRestartTarget* _tmp2_;
	gchar* path = NULL;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* content = NULL;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* current = NULL;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp14_ = FALSE;
	gboolean desired_absent = FALSE;
	const gchar* _tmp15_ = NULL;
	gchar* desired = NULL;
	gchar* _tmp16_;
	const gchar* _tmp17_ = NULL;
	const gchar* _tmp18_;
	ProtonPlusModelsSteamRestartTarget* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp33_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp34_;
	const gchar* _tmp35_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp36_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp37_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (steam != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	if (!proton_plus_models_launchers_steam_external_compatibility_tool_remains_available (steam, value)) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp0_;
		_tmp0_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "The externally managed compatibility tool is no longer available.");
		result = _tmp0_;
		return result;
	}
	_tmp1_ = proton_plus_models_launcher_get_steam_restart_target ((ProtonPlusModelsLauncher*) steam);
	target = _tmp1_;
	_tmp2_ = target;
	if (_tmp2_ == NULL) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp3_;
		_tmp3_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "No Steam target.");
		result = _tmp3_;
		_g_object_unref0 (target);
		return result;
	}
	_tmp4_ = ((ProtonPlusModelsLauncher*) steam)->directory;
	_tmp5_ = g_build_filename (_tmp4_, "config", "config.vdf", NULL);
	path = _tmp5_;
	_tmp6_ = path;
	if (!g_file_test (_tmp6_, G_FILE_TEST_IS_REGULAR)) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp7_;
		_tmp7_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "config.vdf is missing.");
		result = _tmp7_;
		_g_free0 (path);
		_g_object_unref0 (target);
		return result;
	}
	_tmp8_ = path;
	_tmp9_ = proton_plus_utils_filesystem_get_file_content (_tmp8_, FALSE);
	content = _tmp9_;
	_tmp10_ = content;
	_tmp11_ = proton_plus_services_steam_configuration_service_compatibility_value (self, _tmp10_, appid);
	current = _tmp11_;
	_tmp12_ = current;
	if (_tmp12_ == NULL) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp13_;
		_tmp13_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Malformed config.vdf.");
		result = _tmp13_;
		_g_free0 (current);
		_g_free0 (content);
		_g_free0 (path);
		_g_object_unref0 (target);
		return result;
	}
	if (appid != ((guint) 0)) {
		_tmp14_ = g_strcmp0 (value, "Default") == 0;
	} else {
		_tmp14_ = FALSE;
	}
	desired_absent = _tmp14_;
	if (desired_absent) {
		_tmp15_ = "";
	} else {
		_tmp15_ = value;
	}
	_tmp16_ = g_strdup (_tmp15_);
	desired = _tmp16_;
	_tmp18_ = current;
	if (g_strcmp0 (_tmp18_, PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT) == 0) {
		_tmp17_ = "";
	} else {
		const gchar* _tmp19_;
		_tmp19_ = current;
		_tmp17_ = (const gchar*) _tmp19_;
	}
	_tmp20_ = target;
	_tmp21_ = path;
	_tmp22_ = g_canonicalize_filename (_tmp21_, NULL);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup_printf ("%s#CompatToolMapping/%u", _tmp23_, appid);
	_tmp25_ = _tmp24_;
	_tmp26_ = path;
	_tmp27_ = g_canonicalize_filename (_tmp26_, NULL);
	_tmp28_ = _tmp27_;
	_tmp29_ = g_strdup_printf ("%u", appid);
	_tmp30_ = _tmp29_;
	_tmp31_ = desired;
	_tmp32_ = current;
	_tmp33_ = proton_plus_models_steam_configuration_intent_new (PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_CONFIG, PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_COMPATIBILITY_MAPPING, _tmp28_, _tmp30_, _tmp17_, _tmp31_, g_strcmp0 (_tmp32_, PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT) != 0, !desired_absent, NULL);
	_tmp34_ = _tmp33_;
	_tmp35_ = content;
	_tmp36_ = proton_plus_services_steam_configuration_service_submit (self, _tmp20_, kind, _tmp25_, _tmp34_, _tmp35_);
	_tmp37_ = _tmp36_;
	_g_object_unref0 (_tmp34_);
	_g_free0 (_tmp30_);
	_g_free0 (_tmp28_);
	_g_free0 (_tmp25_);
	_g_free0 (_tmp23_);
	result = _tmp37_;
	_g_free0 (desired);
	_g_free0 (current);
	_g_free0 (content);
	_g_free0 (path);
	_g_object_unref0 (target);
	return result;
}

static ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_submit (ProtonPlusServicesSteamConfigurationService* self,
                                                         ProtonPlusModelsSteamRestartTarget* target,
                                                         ProtonPlusModelsSteamChangeKind kind,
                                                         const gchar* key,
                                                         ProtonPlusModelsSteamConfigurationIntent* intent,
                                                         const gchar* content)
{
	ProtonPlusModelsSteamConfigurationIntent* existing = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp0_;
	ProtonPlusModelsSteamConfigurationIntent* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ProtonPlusModelsSteamConfigurationIntent* _tmp3_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	ProtonPlusModelsSteamConfigurationIntent* _tmp8_;
	ProtonPlusServicesSteamSessionSnapshot* snapshot = NULL;
	ProtonPlusServicesSteamSessionService* _tmp18_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp19_;
	gboolean _tmp20_ = FALSE;
	ProtonPlusServicesSteamSessionSnapshot* _tmp21_;
	ProtonPlusServicesSteamSessionState _tmp22_;
	ProtonPlusServicesSteamSessionState _tmp23_;
	ProtonPlusModelsSteamChangeReceipt* receipt = NULL;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	ProtonPlusModelsSteamChangeReceipt* _tmp31_;
	ProtonPlusServicesSteamRestartRecordResult recorded = 0;
	ProtonPlusServicesSteamRestartManager* _tmp32_;
	ProtonPlusModelsSteamChangeReceipt* _tmp33_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp39_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	g_return_val_if_fail (intent != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	_tmp0_ = self->priv->manager;
	_tmp1_ = proton_plus_services_steam_restart_manager_get_pending_configuration_intent (_tmp0_, target, key);
	existing = _tmp1_;
	_tmp3_ = existing;
	if (_tmp3_ != NULL) {
		ProtonPlusModelsSteamConfigurationIntent* _tmp4_;
		_tmp4_ = existing;
		_tmp2_ = proton_plus_services_steam_configuration_service_same_desired (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), intent);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp5_;
		_tmp5_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp5_;
		_g_object_unref0 (existing);
		return result;
	}
	_tmp8_ = existing;
	if (_tmp8_ == NULL) {
		gboolean _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp9_ = proton_plus_models_steam_configuration_intent_get_baseline_present (intent);
		_tmp10_ = _tmp9_;
		_tmp11_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
		_tmp12_ = _tmp11_;
		_tmp7_ = _tmp10_ == _tmp12_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp13_ = proton_plus_models_steam_configuration_intent_get_baseline (intent);
		_tmp14_ = _tmp13_;
		_tmp15_ = proton_plus_models_steam_configuration_intent_get_desired (intent);
		_tmp16_ = _tmp15_;
		_tmp6_ = g_strcmp0 (_tmp14_, _tmp16_) == 0;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp17_;
		_tmp17_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp17_;
		_g_object_unref0 (existing);
		return result;
	}
	_tmp18_ = self->priv->sessions;
	_tmp19_ = proton_plus_services_steam_session_service_inspect (_tmp18_, target);
	snapshot = _tmp19_;
	_tmp21_ = snapshot;
	_tmp22_ = proton_plus_services_steam_session_snapshot_get_state (_tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STOPPED) {
		ProtonPlusServicesSteamSessionSnapshot* _tmp24_;
		ProtonPlusServicesSteamEvidenceLevel _tmp25_;
		ProtonPlusServicesSteamEvidenceLevel _tmp26_;
		_tmp24_ = snapshot;
		_tmp25_ = proton_plus_services_steam_session_snapshot_get_state_confidence (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp20_ = _tmp26_ == PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		gboolean changed = FALSE;
		ProtonPlusServicesSteamConfigurationMutationResult _tmp27_ = 0;
		ProtonPlusServicesSteamConfigurationMutation* _tmp28_;
		changed = proton_plus_services_steam_configuration_service_apply_intent (self, intent, content, TRUE);
		if (changed) {
			_tmp27_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED;
		} else {
			_tmp27_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED;
		}
		_tmp28_ = proton_plus_services_steam_configuration_mutation_new (_tmp27_, NULL);
		result = _tmp28_;
		_g_object_unref0 (snapshot);
		_g_object_unref0 (existing);
		return result;
	}
	_tmp29_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
	_tmp30_ = _tmp29_;
	_tmp31_ = proton_plus_models_steam_change_receipt_new (target, kind, PROTON_PLUS_MODELS_STEAM_RESTART_REQUIREMENT_CONSERVATIVE, key, _tmp30_, NULL, NULL, intent);
	receipt = _tmp31_;
	_tmp32_ = self->priv->manager;
	_tmp33_ = receipt;
	recorded = proton_plus_services_steam_change_recorder_record ((ProtonPlusServicesSteamChangeRecorder*) _tmp32_, _tmp33_);
	if (recorded == PROTON_PLUS_SERVICES_STEAM_RESTART_RECORD_RESULT_PERSISTENCE_FAILED) {
		ProtonPlusServicesSteamRestartManager* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		ProtonPlusServicesSteamConfigurationMutation* _tmp37_;
		_tmp34_ = self->priv->manager;
		_tmp35_ = proton_plus_services_steam_restart_manager_get_last_persistence_error (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PERSISTENCE_FAILED, _tmp36_);
		result = _tmp37_;
		_g_object_unref0 (receipt);
		_g_object_unref0 (snapshot);
		_g_object_unref0 (existing);
		return result;
	}
	if (recorded == PROTON_PLUS_SERVICES_STEAM_RESTART_RECORD_RESULT_REQUIREMENT_CLEARED) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp38_;
		_tmp38_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED, NULL);
		result = _tmp38_;
		_g_object_unref0 (receipt);
		_g_object_unref0 (snapshot);
		_g_object_unref0 (existing);
		return result;
	}
	_tmp39_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED, NULL);
	result = _tmp39_;
	_g_object_unref0 (receipt);
	_g_object_unref0 (snapshot);
	_g_object_unref0 (existing);
	return result;
}

static ProtonPlusServicesSteamConfigurationMutation*
proton_plus_services_steam_configuration_service_real_reconcile_target (ProtonPlusServicesSteamConfigurationReconciler* base,
                                                                        ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusServicesSteamConfigurationService * self;
	ProtonPlusServicesSteamSessionSnapshot* snapshot = NULL;
	ProtonPlusServicesSteamSessionService* _tmp0_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ProtonPlusServicesSteamSessionSnapshot* _tmp3_;
	ProtonPlusServicesSteamSessionState _tmp4_;
	ProtonPlusServicesSteamSessionState _tmp5_;
	ProtonPlusServicesSteamConfigurationMutationResult aggregate = 0;
	GeeList* records = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp10_;
	GeeList* _tmp11_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp78_;
	ProtonPlusServicesSteamConfigurationMutation* result;
	self = (ProtonPlusServicesSteamConfigurationService*) base;
	g_return_val_if_fail (target != NULL, NULL);
	_tmp0_ = self->priv->sessions;
	_tmp1_ = proton_plus_services_steam_session_service_inspect (_tmp0_, target);
	snapshot = _tmp1_;
	_tmp3_ = snapshot;
	_tmp4_ = proton_plus_services_steam_session_snapshot_get_state (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STOPPED) {
		_tmp2_ = TRUE;
	} else {
		ProtonPlusServicesSteamSessionSnapshot* _tmp6_;
		ProtonPlusServicesSteamEvidenceLevel _tmp7_;
		ProtonPlusServicesSteamEvidenceLevel _tmp8_;
		_tmp6_ = snapshot;
		_tmp7_ = proton_plus_services_steam_session_snapshot_get_state_confidence (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = _tmp8_ != PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	}
	if (_tmp2_) {
		ProtonPlusServicesSteamConfigurationMutation* _tmp9_;
		_tmp9_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_STAGED, "Steam has not been confirmed stopped.");
		result = _tmp9_;
		_g_object_unref0 (snapshot);
		return result;
	}
	aggregate = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_UNCHANGED;
	_tmp10_ = self->priv->manager;
	_tmp11_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp10_, target);
	records = _tmp11_;
	{
		GeeList* _record_list = NULL;
		GeeList* _tmp12_;
		gint _record_size = 0;
		GeeList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _record_index = 0;
		_tmp12_ = records;
		_record_list = _tmp12_;
		_tmp13_ = _record_list;
		_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_record_size = _tmp15_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp18_;
			gpointer _tmp19_;
			ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp20_;
			ProtonPlusModelsSteamChangeReceipt* _tmp21_;
			ProtonPlusModelsSteamChangeReceipt* _tmp22_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp23_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp24_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp25_;
			gboolean _tmp26_ = FALSE;
			ProtonPlusModelsSteamConfigurationIntent* _tmp27_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp31_;
			_record_index = _record_index + 1;
			_tmp16_ = _record_index;
			_tmp17_ = _record_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _record_list;
			_tmp19_ = gee_list_get (_tmp18_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp19_;
			_tmp20_ = record;
			_tmp21_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = _g_object_ref0 (_tmp24_);
			intent = _tmp25_;
			_tmp27_ = intent;
			if (_tmp27_ == NULL) {
				_tmp26_ = TRUE;
			} else {
				ProtonPlusModelsSteamConfigurationIntent* _tmp28_;
				ProtonPlusModelsSteamConfigurationOperation _tmp29_;
				ProtonPlusModelsSteamConfigurationOperation _tmp30_;
				_tmp28_ = intent;
				_tmp29_ = proton_plus_models_steam_configuration_intent_get_operation (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp30_ = _tmp29_;
				_tmp26_ = _tmp30_ != PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUTS_FILE_PRESENT;
			}
			if (_tmp26_) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp31_ = intent;
			if (!proton_plus_services_steam_configuration_service_apply_pending_intent (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent))) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp32_;
				_tmp32_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Unable to create shortcuts.vdf.");
				result = _tmp32_;
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (records);
				_g_object_unref0 (snapshot);
				return result;
			}
			aggregate = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED;
			_g_object_unref0 (intent);
			_g_object_unref0 (record);
		}
	}
	{
		GeeList* _record_list = NULL;
		GeeList* _tmp33_;
		gint _record_size = 0;
		GeeList* _tmp34_;
		gint _tmp35_;
		gint _tmp36_;
		gint _record_index = 0;
		_tmp33_ = records;
		_record_list = _tmp33_;
		_tmp34_ = _record_list;
		_tmp35_ = gee_collection_get_size ((GeeCollection*) _tmp34_);
		_tmp36_ = _tmp35_;
		_record_size = _tmp36_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp37_;
			gint _tmp38_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp39_;
			gpointer _tmp40_;
			ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp41_;
			ProtonPlusModelsSteamChangeReceipt* _tmp42_;
			ProtonPlusModelsSteamChangeReceipt* _tmp43_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp44_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp45_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp46_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp47_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp48_;
			ProtonPlusModelsSteamConfigurationOperation _tmp49_;
			ProtonPlusModelsSteamConfigurationOperation _tmp50_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp51_;
			const gchar* _tmp52_;
			const gchar* _tmp53_;
			gchar* _tmp55_ = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp56_;
			ProtonPlusModelsSteamConfigurationFile _tmp57_;
			ProtonPlusModelsSteamConfigurationFile _tmp58_;
			gchar* content = NULL;
			gchar* _tmp64_;
			gchar* current = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp65_;
			const gchar* _tmp66_;
			gchar* _tmp67_;
			const gchar* _tmp68_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp70_;
			const gchar* _tmp71_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp72_;
			const gchar* _tmp73_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp75_;
			const gchar* _tmp76_;
			_record_index = _record_index + 1;
			_tmp37_ = _record_index;
			_tmp38_ = _record_size;
			if (!(_tmp37_ < _tmp38_)) {
				break;
			}
			_tmp39_ = _record_list;
			_tmp40_ = gee_list_get (_tmp39_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp40_;
			_tmp41_ = record;
			_tmp42_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = _g_object_ref0 (_tmp45_);
			intent = _tmp46_;
			_tmp47_ = intent;
			if (_tmp47_ == NULL) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp48_ = intent;
			_tmp49_ = proton_plus_models_steam_configuration_intent_get_operation (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp50_ = _tmp49_;
			if (_tmp50_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUTS_FILE_PRESENT) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp51_ = intent;
			_tmp52_ = proton_plus_models_steam_configuration_intent_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp53_ = _tmp52_;
			if (!g_file_test (_tmp53_, G_FILE_TEST_IS_REGULAR)) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp54_;
				_tmp54_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Configuration file is missing.");
				result = _tmp54_;
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (records);
				_g_object_unref0 (snapshot);
				return result;
			}
			_tmp56_ = intent;
			_tmp57_ = proton_plus_models_steam_configuration_intent_get_file (_tmp56_);
			_tmp58_ = _tmp57_;
			if (_tmp58_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_SHORTCUTS) {
				gchar* _tmp59_;
				_tmp59_ = g_strdup ("");
				_g_free0 (_tmp55_);
				_tmp55_ = _tmp59_;
			} else {
				ProtonPlusModelsSteamConfigurationIntent* _tmp60_;
				const gchar* _tmp61_;
				const gchar* _tmp62_;
				gchar* _tmp63_;
				_tmp60_ = intent;
				_tmp61_ = proton_plus_models_steam_configuration_intent_get_path (_tmp60_);
				_tmp62_ = _tmp61_;
				_tmp63_ = proton_plus_utils_filesystem_get_file_content (_tmp62_, FALSE);
				_g_free0 (_tmp55_);
				_tmp55_ = _tmp63_;
			}
			_tmp64_ = _tmp55_;
			_tmp55_ = NULL;
			content = _tmp64_;
			_tmp65_ = intent;
			_tmp66_ = content;
			_tmp67_ = proton_plus_services_steam_configuration_service_value_for_intent (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp66_);
			current = _tmp67_;
			_tmp68_ = current;
			if (_tmp68_ == NULL) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp69_;
				_tmp69_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Configuration file could not be parsed.");
				result = _tmp69_;
				_g_free0 (current);
				_g_free0 (content);
				_g_free0 (_tmp55_);
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (records);
				_g_object_unref0 (snapshot);
				return result;
			}
			_tmp70_ = intent;
			_tmp71_ = current;
			if (proton_plus_services_steam_configuration_service_matches_desired (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp71_)) {
				_g_free0 (current);
				_g_free0 (content);
				_g_free0 (_tmp55_);
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp72_ = intent;
			_tmp73_ = current;
			if (!proton_plus_services_steam_configuration_service_matches_baseline (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp73_)) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp74_;
				_tmp74_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CONFLICT, "The targeted Steam setting changed externally.");
				result = _tmp74_;
				_g_free0 (current);
				_g_free0 (content);
				_g_free0 (_tmp55_);
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (records);
				_g_object_unref0 (snapshot);
				return result;
			}
			_tmp75_ = intent;
			_tmp76_ = content;
			if (!proton_plus_services_steam_configuration_service_apply_intent (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp76_, TRUE)) {
				ProtonPlusServicesSteamConfigurationMutation* _tmp77_;
				_tmp77_ = proton_plus_services_steam_configuration_mutation_new (PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED, "Unable to apply a pending Steam setting.");
				result = _tmp77_;
				_g_free0 (current);
				_g_free0 (content);
				_g_free0 (_tmp55_);
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (records);
				_g_object_unref0 (snapshot);
				return result;
			}
			aggregate = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CHANGED;
			_g_free0 (current);
			_g_free0 (content);
			_g_free0 (_tmp55_);
			_g_object_unref0 (intent);
			_g_object_unref0 (record);
		}
	}
	_tmp78_ = proton_plus_services_steam_configuration_mutation_new (aggregate, NULL);
	result = _tmp78_;
	_g_object_unref0 (records);
	_g_object_unref0 (snapshot);
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_real_verify_target_after_session (ProtonPlusServicesSteamConfigurationReconciler* base,
                                                                                   ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusServicesSteamConfigurationService * self;
	GeeArrayList* verified = NULL;
	GeeArrayList* _tmp0_;
	ProtonPlusServicesSteamRestartManager* _tmp37_;
	GeeArrayList* _tmp38_;
	gboolean result;
	self = (ProtonPlusServicesSteamConfigurationService*) base;
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = gee_array_list_new (PROTON_PLUS_MODELS_TYPE_STEAM_RESTART_PENDING_RECORD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	verified = _tmp0_;
	{
		GeeList* _record_list = NULL;
		ProtonPlusServicesSteamRestartManager* _tmp1_;
		GeeList* _tmp2_;
		gint _record_size = 0;
		GeeList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _record_index = 0;
		_tmp1_ = self->priv->manager;
		_tmp2_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp1_, target);
		_record_list = _tmp2_;
		_tmp3_ = _record_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_record_size = _tmp5_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp8_;
			gpointer _tmp9_;
			ProtonPlusModelsSteamConfigurationIntent* intent = NULL;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp10_;
			ProtonPlusModelsSteamChangeReceipt* _tmp11_;
			ProtonPlusModelsSteamChangeReceipt* _tmp12_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp13_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp14_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp15_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp16_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			gchar* _tmp20_ = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp21_;
			ProtonPlusModelsSteamConfigurationFile _tmp22_;
			ProtonPlusModelsSteamConfigurationFile _tmp23_;
			gchar* content = NULL;
			gchar* _tmp29_;
			gchar* current = NULL;
			ProtonPlusModelsSteamConfigurationIntent* _tmp30_;
			const gchar* _tmp31_;
			gchar* _tmp32_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp33_;
			const gchar* _tmp34_;
			GeeArrayList* _tmp35_;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp36_;
			_record_index = _record_index + 1;
			_tmp6_ = _record_index;
			_tmp7_ = _record_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _record_list;
			_tmp9_ = gee_list_get (_tmp8_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp9_;
			_tmp10_ = record;
			_tmp11_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = _g_object_ref0 (_tmp14_);
			intent = _tmp15_;
			_tmp16_ = intent;
			if (_tmp16_ == NULL) {
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				continue;
			}
			_tmp17_ = intent;
			_tmp18_ = proton_plus_models_steam_configuration_intent_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp19_ = _tmp18_;
			if (!g_file_test (_tmp19_, G_FILE_TEST_IS_REGULAR)) {
				result = FALSE;
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (_record_list);
				_g_object_unref0 (verified);
				return result;
			}
			_tmp21_ = intent;
			_tmp22_ = proton_plus_models_steam_configuration_intent_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
			_tmp23_ = _tmp22_;
			if (_tmp23_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_FILE_SHORTCUTS) {
				gchar* _tmp24_;
				_tmp24_ = g_strdup ("");
				_g_free0 (_tmp20_);
				_tmp20_ = _tmp24_;
			} else {
				ProtonPlusModelsSteamConfigurationIntent* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				gchar* _tmp28_;
				_tmp25_ = intent;
				_tmp26_ = proton_plus_models_steam_configuration_intent_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent));
				_tmp27_ = _tmp26_;
				_tmp28_ = proton_plus_utils_filesystem_get_file_content (_tmp27_, FALSE);
				_g_free0 (_tmp20_);
				_tmp20_ = _tmp28_;
			}
			_tmp29_ = _tmp20_;
			_tmp20_ = NULL;
			content = _tmp29_;
			_tmp30_ = intent;
			_tmp31_ = content;
			_tmp32_ = proton_plus_services_steam_configuration_service_value_for_intent (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp31_);
			current = _tmp32_;
			_tmp33_ = intent;
			_tmp34_ = current;
			if (!proton_plus_services_steam_configuration_service_matches_desired (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, PROTON_PLUS_MODELS_TYPE_STEAM_CONFIGURATION_INTENT, ProtonPlusModelsSteamConfigurationIntent), _tmp34_)) {
				result = FALSE;
				_g_free0 (current);
				_g_free0 (content);
				_g_free0 (_tmp20_);
				_g_object_unref0 (intent);
				_g_object_unref0 (record);
				_g_object_unref0 (_record_list);
				_g_object_unref0 (verified);
				return result;
			}
			_tmp35_ = verified;
			_tmp36_ = record;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp35_, _tmp36_);
			_g_free0 (current);
			_g_free0 (content);
			_g_free0 (_tmp20_);
			_g_object_unref0 (intent);
			_g_object_unref0 (record);
		}
		_g_object_unref0 (_record_list);
	}
	_tmp37_ = self->priv->manager;
	_tmp38_ = verified;
	result = proton_plus_services_steam_restart_manager_clear_verified_configurations (_tmp37_, (GeeCollection*) _tmp38_);
	_g_object_unref0 (verified);
	return result;
}

static gchar*
proton_plus_services_steam_configuration_service_value_for_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                   ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                   const gchar* content)
{
	ProtonPlusModelsSteamConfigurationOperation _tmp0_;
	ProtonPlusModelsSteamConfigurationOperation _tmp1_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (intent != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	_tmp0_ = proton_plus_models_steam_configuration_intent_get_operation (intent);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_COMPATIBILITY_MAPPING:
		{
			guint appid = 0U;
			const gchar* _tmp2_;
			const gchar* _tmp3_;
			guint _tmp4_ = 0U;
			gboolean _tmp5_;
			gchar* _tmp6_;
			_tmp2_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp3_ = _tmp2_;
			_tmp5_ = uint_try_parse (_tmp3_, &_tmp4_, NULL, (guint) 0);
			appid = _tmp4_;
			if (!_tmp5_) {
				result = NULL;
				return result;
			}
			_tmp6_ = proton_plus_services_steam_configuration_service_compatibility_value (self, content, appid);
			result = _tmp6_;
			return result;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_LAUNCH_OPTIONS:
		{
			guint appid = 0U;
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			guint _tmp9_ = 0U;
			gboolean _tmp10_;
			gchar* _tmp11_;
			_tmp7_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp8_ = _tmp7_;
			_tmp10_ = uint_try_parse (_tmp8_, &_tmp9_, NULL, (guint) 0);
			appid = _tmp9_;
			if (!_tmp10_) {
				result = NULL;
				return result;
			}
			_tmp11_ = proton_plus_services_steam_configuration_service_launch_value (self, content, appid);
			result = _tmp11_;
			return result;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_LAUNCH_OPTIONS:
		{
			guint shortcut_id = 0U;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			guint _tmp14_ = 0U;
			gboolean _tmp15_;
			_tmp12_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp13_ = _tmp12_;
			_tmp15_ = uint_try_parse (_tmp13_, &_tmp14_, NULL, (guint) 0);
			shortcut_id = _tmp14_;
			if (!_tmp15_) {
				result = NULL;
				return result;
			}
			{
				ProtonPlusUtilsVDFShortcuts* _tmp16_ = NULL;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				ProtonPlusUtilsVDFShortcuts* _tmp19_;
				ProtonPlusUtilsVDFShortcut _tmp20_ = {0};
				ProtonPlusUtilsVDFShortcut _tmp21_;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				_tmp17_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp18_ = _tmp17_;
				_tmp19_ = proton_plus_utils_vdf_shortcuts_load (_tmp18_, &_inner_error0_);
				_tmp16_ = _tmp19_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				proton_plus_utils_vdf_shortcuts_get_shortcut_by_appid (_tmp16_, shortcut_id, &_tmp20_);
				_tmp21_ = _tmp20_;
				_tmp22_ = _tmp21_.LaunchOptions;
				_tmp23_ = g_strdup (_tmp22_);
				_tmp24_ = _tmp23_;
				proton_plus_utils_vdf_shortcut_destroy (&_tmp21_);
				result = _tmp24_;
				_proton_plus_utils_vdf_binary_unref0 (_tmp16_);
				return result;
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				result = NULL;
				return result;
			}
			__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;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUTS_FILE_PRESENT:
		{
			const gchar* _tmp25_ = NULL;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			_tmp26_ = proton_plus_models_steam_configuration_intent_get_path (intent);
			_tmp27_ = _tmp26_;
			if (g_file_test (_tmp27_, G_FILE_TEST_IS_REGULAR)) {
				_tmp25_ = "present";
			} else {
				_tmp25_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT;
			}
			_tmp28_ = g_strdup (_tmp25_);
			result = _tmp28_;
			return result;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_PRESENCE:
		{
			{
				const gchar* _tmp29_ = NULL;
				ProtonPlusUtilsVDFShortcuts* _tmp30_ = NULL;
				const gchar* _tmp31_;
				const gchar* _tmp32_;
				ProtonPlusUtilsVDFShortcuts* _tmp33_;
				gchar* _tmp34_;
				_tmp31_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp32_ = _tmp31_;
				_tmp33_ = proton_plus_utils_vdf_shortcuts_load (_tmp32_, &_inner_error0_);
				_tmp30_ = _tmp33_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				if (proton_plus_utils_vdf_shortcuts_get_installed_status (_tmp30_)) {
					_tmp29_ = "present";
				} else {
					_tmp29_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT;
				}
				_tmp34_ = g_strdup (_tmp29_);
				result = _tmp34_;
				_proton_plus_utils_vdf_binary_unref0 (_tmp30_);
				return result;
			}
			goto __finally1;
			__catch1_g_error:
			{
				const gchar* _tmp35_ = NULL;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				gchar* _tmp38_;
				g_clear_error (&_inner_error0_);
				_tmp36_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp37_ = _tmp36_;
				if (g_file_test (_tmp37_, G_FILE_TEST_EXISTS)) {
					_tmp35_ = NULL;
				} else {
					_tmp35_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT;
				}
				_tmp38_ = g_strdup (_tmp35_);
				result = _tmp38_;
				return result;
			}
			__finally1:
			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;
		}
		default:
		{
			result = NULL;
			return result;
		}
	}
}

static gboolean
proton_plus_services_steam_configuration_service_apply_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                               ProtonPlusModelsSteamConfigurationIntent* intent,
                                                               const gchar* content,
                                                               gboolean write)
{
	gchar* modified = NULL;
	ProtonPlusModelsSteamConfigurationOperation _tmp0_;
	ProtonPlusModelsSteamConfigurationOperation _tmp1_;
	gboolean _tmp40_ = FALSE;
	const gchar* _tmp41_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (intent != NULL, FALSE);
	g_return_val_if_fail (content != NULL, FALSE);
	modified = NULL;
	_tmp0_ = proton_plus_models_steam_configuration_intent_get_operation (intent);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_COMPATIBILITY_MAPPING:
		{
			guint appid = 0U;
			const gchar* _tmp2_;
			const gchar* _tmp3_;
			guint _tmp4_ = 0U;
			gboolean _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			gboolean _tmp8_;
			gboolean _tmp9_;
			gchar* _tmp10_;
			_tmp2_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp3_ = _tmp2_;
			_tmp5_ = uint_try_parse (_tmp3_, &_tmp4_, NULL, (guint) 0);
			appid = _tmp4_;
			if (!_tmp5_) {
				result = FALSE;
				_g_free0 (modified);
				return result;
			}
			_tmp6_ = proton_plus_models_steam_configuration_intent_get_desired (intent);
			_tmp7_ = _tmp6_;
			_tmp8_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
			_tmp9_ = _tmp8_;
			_tmp10_ = proton_plus_services_steam_configuration_service_mutate_compatibility (self, content, appid, _tmp7_, _tmp9_);
			_g_free0 (modified);
			modified = _tmp10_;
			break;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_LAUNCH_OPTIONS:
		{
			guint appid = 0U;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			guint _tmp13_ = 0U;
			gboolean _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gboolean _tmp17_;
			gboolean _tmp18_;
			gchar* _tmp19_;
			_tmp11_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp12_ = _tmp11_;
			_tmp14_ = uint_try_parse (_tmp12_, &_tmp13_, NULL, (guint) 0);
			appid = _tmp13_;
			if (!_tmp14_) {
				result = FALSE;
				_g_free0 (modified);
				return result;
			}
			_tmp15_ = proton_plus_models_steam_configuration_intent_get_desired (intent);
			_tmp16_ = _tmp15_;
			_tmp17_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
			_tmp18_ = _tmp17_;
			_tmp19_ = proton_plus_services_steam_configuration_service_mutate_launch (self, content, appid, _tmp16_, _tmp18_);
			_g_free0 (modified);
			modified = _tmp19_;
			break;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_LAUNCH_OPTIONS:
		{
			guint shortcut_id = 0U;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			guint _tmp22_ = 0U;
			gboolean _tmp23_;
			gboolean _tmp39_ = FALSE;
			_tmp20_ = proton_plus_models_steam_configuration_intent_get_field_id (intent);
			_tmp21_ = _tmp20_;
			_tmp23_ = uint_try_parse (_tmp21_, &_tmp22_, NULL, (guint) 0);
			shortcut_id = _tmp22_;
			if (!_tmp23_) {
				result = FALSE;
				_g_free0 (modified);
				return result;
			}
			{
				ProtonPlusUtilsVDFShortcuts* shortcuts = NULL;
				const gchar* _tmp24_;
				const gchar* _tmp25_;
				ProtonPlusUtilsVDFShortcuts* _tmp26_;
				ProtonPlusUtilsVDFShortcut shortcut = {0};
				ProtonPlusUtilsVDFShortcuts* _tmp27_;
				ProtonPlusUtilsVDFShortcut _tmp28_ = {0};
				ProtonPlusUtilsVDFShortcut _tmp29_;
				const gchar* _tmp30_;
				gboolean _tmp31_;
				gboolean _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				gchar* _tmp35_;
				ProtonPlusUtilsVDFShortcuts* _tmp36_;
				ProtonPlusUtilsVDFShortcut _tmp37_;
				_tmp24_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp25_ = _tmp24_;
				_tmp26_ = proton_plus_utils_vdf_shortcuts_load (_tmp25_, &_inner_error0_);
				shortcuts = _tmp26_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp27_ = shortcuts;
				proton_plus_utils_vdf_shortcuts_get_shortcut_by_appid (_tmp27_, shortcut_id, &_tmp28_);
				shortcut = _tmp28_;
				_tmp29_ = shortcut;
				_tmp30_ = _tmp29_.AppName;
				if (_tmp30_ == NULL) {
					result = FALSE;
					proton_plus_utils_vdf_shortcut_destroy (&shortcut);
					_proton_plus_utils_vdf_binary_unref0 (shortcuts);
					_g_free0 (modified);
					return result;
				}
				_tmp31_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
				_tmp32_ = _tmp31_;
				if (!_tmp32_) {
					result = FALSE;
					proton_plus_utils_vdf_shortcut_destroy (&shortcut);
					_proton_plus_utils_vdf_binary_unref0 (shortcuts);
					_g_free0 (modified);
					return result;
				}
				_tmp33_ = proton_plus_models_steam_configuration_intent_get_desired (intent);
				_tmp34_ = _tmp33_;
				_tmp35_ = g_strdup (_tmp34_);
				_g_free0 (shortcut.LaunchOptions);
				shortcut.LaunchOptions = _tmp35_;
				_tmp36_ = shortcuts;
				_tmp37_ = shortcut;
				if (!proton_plus_utils_vdf_shortcuts_replace_shortcut_by_appid (_tmp36_, shortcut_id, &_tmp37_)) {
					result = FALSE;
					proton_plus_utils_vdf_shortcut_destroy (&shortcut);
					_proton_plus_utils_vdf_binary_unref0 (shortcuts);
					_g_free0 (modified);
					return result;
				}
				if (write) {
					ProtonPlusUtilsVDFShortcuts* _tmp38_;
					_tmp38_ = shortcuts;
					proton_plus_utils_vdf_binary_save ((ProtonPlusUtilsVDFBinary*) _tmp38_, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						proton_plus_utils_vdf_shortcut_destroy (&shortcut);
						_proton_plus_utils_vdf_binary_unref0 (shortcuts);
						goto __catch0_g_error;
					}
				}
				result = TRUE;
				proton_plus_utils_vdf_shortcut_destroy (&shortcut);
				_proton_plus_utils_vdf_binary_unref0 (shortcuts);
				_g_free0 (modified);
				return result;
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				result = FALSE;
				_g_free0 (modified);
				return result;
			}
			__finally0:
			_g_free0 (modified);
			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 _tmp39_;
		}
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUTS_FILE_PRESENT:
		case PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_PRESENCE:
		{
			result = proton_plus_services_steam_configuration_service_apply_pending_intent (self, intent);
			_g_free0 (modified);
			return result;
		}
		default:
		{
			result = FALSE;
			_g_free0 (modified);
			return result;
		}
	}
	_tmp41_ = modified;
	if (_tmp41_ != NULL) {
		gboolean _tmp42_ = FALSE;
		if (!write) {
			_tmp42_ = TRUE;
		} else {
			const gchar* _tmp43_;
			const gchar* _tmp44_;
			const gchar* _tmp45_;
			_tmp43_ = proton_plus_models_steam_configuration_intent_get_path (intent);
			_tmp44_ = _tmp43_;
			_tmp45_ = modified;
			_tmp42_ = proton_plus_utils_filesystem_modify_file (_tmp44_, (const gchar*) _tmp45_);
		}
		_tmp40_ = _tmp42_;
	} else {
		_tmp40_ = FALSE;
	}
	result = _tmp40_;
	_g_free0 (modified);
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_apply_pending_intent (ProtonPlusServicesSteamConfigurationService* self,
                                                                       ProtonPlusModelsSteamConfigurationIntent* intent)
{
	ProtonPlusModelsSteamConfigurationOperation _tmp0_;
	ProtonPlusModelsSteamConfigurationOperation _tmp1_;
	ProtonPlusModelsSteamConfigurationOperation _tmp9_;
	ProtonPlusModelsSteamConfigurationOperation _tmp10_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gboolean _tmp36_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (intent != NULL, FALSE);
	_tmp0_ = proton_plus_models_steam_configuration_intent_get_operation (intent);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUTS_FILE_PRESENT) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gboolean _tmp8_ = FALSE;
		_tmp2_ = proton_plus_models_steam_configuration_intent_get_path (intent);
		_tmp3_ = _tmp2_;
		if (g_file_test (_tmp3_, G_FILE_TEST_IS_REGULAR)) {
			result = TRUE;
			return result;
		}
		{
			const gchar* _tmp4_;
			const gchar* _tmp5_;
			ProtonPlusUtilsVDFShortcuts* _tmp6_;
			ProtonPlusUtilsVDFShortcuts* _tmp7_;
			_tmp4_ = proton_plus_models_steam_configuration_intent_get_path (intent);
			_tmp5_ = _tmp4_;
			_tmp6_ = proton_plus_utils_vdf_shortcuts_empty (_tmp5_);
			_tmp7_ = _tmp6_;
			proton_plus_utils_vdf_binary_save ((ProtonPlusUtilsVDFBinary*) _tmp7_, &_inner_error0_);
			_proton_plus_utils_vdf_binary_unref0 (_tmp7_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			result = TRUE;
			return result;
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
			result = FALSE;
			return result;
		}
		__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 _tmp8_;
	}
	_tmp9_ = proton_plus_models_steam_configuration_intent_get_operation (intent);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == PROTON_PLUS_MODELS_STEAM_CONFIGURATION_OPERATION_SHORTCUT_PRESENCE) {
		gboolean _tmp31_ = FALSE;
		{
			ProtonPlusUtilsVDFShortcuts* _tmp11_ = NULL;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			ProtonPlusUtilsVDFShortcuts* shortcuts = NULL;
			ProtonPlusUtilsVDFShortcuts* _tmp20_;
			gboolean _tmp21_;
			gboolean _tmp22_;
			gboolean _tmp27_ = FALSE;
			ProtonPlusUtilsVDFShortcuts* _tmp28_;
			_tmp12_ = proton_plus_models_steam_configuration_intent_get_path (intent);
			_tmp13_ = _tmp12_;
			if (g_file_test (_tmp13_, G_FILE_TEST_IS_REGULAR)) {
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				ProtonPlusUtilsVDFShortcuts* _tmp16_;
				_tmp14_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp15_ = _tmp14_;
				_tmp16_ = proton_plus_utils_vdf_shortcuts_load (_tmp15_, &_inner_error0_);
				_proton_plus_utils_vdf_binary_unref0 (_tmp11_);
				_tmp11_ = _tmp16_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_proton_plus_utils_vdf_binary_unref0 (_tmp11_);
					goto __catch1_g_error;
				}
			} else {
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				ProtonPlusUtilsVDFShortcuts* _tmp19_;
				_tmp17_ = proton_plus_models_steam_configuration_intent_get_path (intent);
				_tmp18_ = _tmp17_;
				_tmp19_ = proton_plus_utils_vdf_shortcuts_empty (_tmp18_);
				_proton_plus_utils_vdf_binary_unref0 (_tmp11_);
				_tmp11_ = _tmp19_;
			}
			_tmp20_ = _tmp11_;
			_tmp11_ = NULL;
			shortcuts = _tmp20_;
			_tmp21_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
			_tmp22_ = _tmp21_;
			if (_tmp22_) {
				gboolean _tmp23_ = FALSE;
				ProtonPlusUtilsVDFShortcuts* _tmp24_;
				_tmp24_ = shortcuts;
				if (proton_plus_utils_vdf_shortcuts_get_installed_status (_tmp24_)) {
					_tmp23_ = TRUE;
				} else {
					ProtonPlusServicesSteamShortcutMutator* _tmp25_;
					ProtonPlusUtilsVDFShortcuts* _tmp26_;
					_tmp25_ = self->priv->shortcut_mutator;
					_tmp26_ = shortcuts;
					_tmp23_ = proton_plus_services_steam_shortcut_mutator_install (_tmp25_, _tmp26_);
				}
				result = _tmp23_;
				_proton_plus_utils_vdf_binary_unref0 (shortcuts);
				_proton_plus_utils_vdf_binary_unref0 (_tmp11_);
				return result;
			}
			_tmp28_ = shortcuts;
			if (!proton_plus_utils_vdf_shortcuts_get_installed_status (_tmp28_)) {
				_tmp27_ = TRUE;
			} else {
				ProtonPlusServicesSteamShortcutMutator* _tmp29_;
				ProtonPlusUtilsVDFShortcuts* _tmp30_;
				_tmp29_ = self->priv->shortcut_mutator;
				_tmp30_ = shortcuts;
				_tmp27_ = proton_plus_services_steam_shortcut_mutator_remove (_tmp29_, _tmp30_);
			}
			result = _tmp27_;
			_proton_plus_utils_vdf_binary_unref0 (shortcuts);
			_proton_plus_utils_vdf_binary_unref0 (_tmp11_);
			return result;
		}
		goto __finally1;
		__catch1_g_error:
		{
			g_clear_error (&_inner_error0_);
			result = FALSE;
			return result;
		}
		__finally1:
		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 _tmp31_;
	}
	_tmp32_ = proton_plus_models_steam_configuration_intent_get_path (intent);
	_tmp33_ = _tmp32_;
	_tmp34_ = proton_plus_utils_filesystem_get_file_content (_tmp33_, FALSE);
	_tmp35_ = _tmp34_;
	_tmp36_ = proton_plus_services_steam_configuration_service_apply_intent (self, intent, _tmp35_, TRUE);
	_g_free0 (_tmp35_);
	result = _tmp36_;
	return result;
}

static gchar*
proton_plus_services_steam_configuration_service_compatibility_value (ProtonPlusServicesSteamConfigurationService* self,
                                                                      const gchar* content,
                                                                      guint appid)
{
	ProtonPlusUtilsVDFVdfDocument* doc = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp0_;
	ProtonPlusUtilsVDFVdfDocument* _tmp1_;
	ProtonPlusUtilsVDFVdfEntry* root = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp2_;
	ProtonPlusUtilsVDFVdfEntry* _tmp3_;
	ProtonPlusUtilsVDFVdfEntry* _tmp4_;
	ProtonPlusUtilsVDFVdfEntry* _tmp5_;
	ProtonPlusUtilsVDFVdfEntry* _tmp6_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp7_;
	ProtonPlusUtilsVDFVdfEntry* software = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* valve = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp15_;
	ProtonPlusUtilsVDFVdfEntry* _tmp16_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp17_;
	ProtonPlusUtilsVDFVdfEntry* steam = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp20_;
	ProtonPlusUtilsVDFVdfEntry* _tmp21_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp22_;
	ProtonPlusUtilsVDFVdfEntry* mapping = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp25_;
	ProtonPlusUtilsVDFVdfEntry* _tmp26_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp27_;
	ProtonPlusUtilsVDFVdfEntry* entry = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp32_;
	ProtonPlusUtilsVDFVdfEntry* _tmp33_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp34_;
	ProtonPlusUtilsVDFVdfEntry* name = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp37_;
	const gchar* _tmp38_ = NULL;
	gboolean _tmp39_ = FALSE;
	ProtonPlusUtilsVDFVdfEntry* _tmp40_;
	gchar* _tmp47_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	_tmp0_ = proton_plus_utils_vdf_vdf_parser_parse_document (content);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (doc);
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp4_, "InstallConfigStore");
	root = _tmp5_;
	_tmp7_ = root;
	if (_tmp7_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp8_;
		ProtonPlusUtilsVDFVdfEntry* _tmp9_;
		_tmp8_ = root;
		_tmp9_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp8_, "Software");
		_g_object_unref0 (_tmp6_);
		_tmp6_ = _tmp9_;
	} else {
		_g_object_unref0 (_tmp6_);
		_tmp6_ = NULL;
	}
	_tmp10_ = _tmp6_;
	_tmp6_ = NULL;
	software = _tmp10_;
	_tmp12_ = software;
	if (_tmp12_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp13_;
		ProtonPlusUtilsVDFVdfEntry* _tmp14_;
		_tmp13_ = software;
		_tmp14_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp13_, "Valve");
		_g_object_unref0 (_tmp11_);
		_tmp11_ = _tmp14_;
	} else {
		_g_object_unref0 (_tmp11_);
		_tmp11_ = NULL;
	}
	_tmp15_ = _tmp11_;
	_tmp11_ = NULL;
	valve = _tmp15_;
	_tmp17_ = valve;
	if (_tmp17_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp18_;
		ProtonPlusUtilsVDFVdfEntry* _tmp19_;
		_tmp18_ = valve;
		_tmp19_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp18_, "Steam");
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp19_;
	} else {
		_g_object_unref0 (_tmp16_);
		_tmp16_ = NULL;
	}
	_tmp20_ = _tmp16_;
	_tmp16_ = NULL;
	steam = _tmp20_;
	_tmp22_ = steam;
	if (_tmp22_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp23_;
		ProtonPlusUtilsVDFVdfEntry* _tmp24_;
		_tmp23_ = steam;
		_tmp24_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp23_, "CompatToolMapping");
		_g_object_unref0 (_tmp21_);
		_tmp21_ = _tmp24_;
	} else {
		_g_object_unref0 (_tmp21_);
		_tmp21_ = NULL;
	}
	_tmp25_ = _tmp21_;
	_tmp21_ = NULL;
	mapping = _tmp25_;
	_tmp27_ = mapping;
	if (_tmp27_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		ProtonPlusUtilsVDFVdfEntry* _tmp31_;
		_tmp28_ = mapping;
		_tmp29_ = g_strdup_printf ("%u", appid);
		_tmp30_ = _tmp29_;
		_tmp31_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp28_, _tmp30_);
		_g_object_unref0 (_tmp26_);
		_tmp26_ = _tmp31_;
		_g_free0 (_tmp30_);
	} else {
		_g_object_unref0 (_tmp26_);
		_tmp26_ = NULL;
	}
	_tmp32_ = _tmp26_;
	_tmp26_ = NULL;
	entry = _tmp32_;
	_tmp34_ = entry;
	if (_tmp34_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp35_;
		ProtonPlusUtilsVDFVdfEntry* _tmp36_;
		_tmp35_ = entry;
		_tmp36_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp35_, "name");
		_g_object_unref0 (_tmp33_);
		_tmp33_ = _tmp36_;
	} else {
		_g_object_unref0 (_tmp33_);
		_tmp33_ = NULL;
	}
	_tmp37_ = _tmp33_;
	_tmp33_ = NULL;
	name = _tmp37_;
	_tmp40_ = name;
	if (_tmp40_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp41_;
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		_tmp41_ = name;
		_tmp42_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp39_ = _tmp43_ != NULL;
	} else {
		_tmp39_ = FALSE;
	}
	if (_tmp39_) {
		ProtonPlusUtilsVDFVdfEntry* _tmp44_;
		const gchar* _tmp45_;
		const gchar* _tmp46_;
		_tmp44_ = name;
		_tmp45_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp38_ = _tmp46_;
	} else {
		_tmp38_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT;
	}
	_tmp47_ = g_strdup (_tmp38_);
	result = _tmp47_;
	_g_object_unref0 (name);
	_g_object_unref0 (_tmp33_);
	_g_object_unref0 (entry);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (mapping);
	_g_object_unref0 (_tmp21_);
	_g_object_unref0 (steam);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (valve);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (software);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (root);
	_g_object_unref0 (doc);
	return result;
}

static gchar*
proton_plus_services_steam_configuration_service_launch_value (ProtonPlusServicesSteamConfigurationService* self,
                                                               const gchar* content,
                                                               guint appid)
{
	ProtonPlusUtilsVDFVdfDocument* doc = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp0_;
	ProtonPlusUtilsVDFVdfDocument* _tmp1_;
	ProtonPlusUtilsVDFVdfEntry* root = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp2_;
	ProtonPlusUtilsVDFVdfEntry* _tmp3_;
	ProtonPlusUtilsVDFVdfEntry* _tmp4_;
	ProtonPlusUtilsVDFVdfEntry* _tmp5_;
	ProtonPlusUtilsVDFVdfEntry* _tmp6_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp7_;
	ProtonPlusUtilsVDFVdfEntry* software = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* valve = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp15_;
	ProtonPlusUtilsVDFVdfEntry* _tmp16_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp17_;
	ProtonPlusUtilsVDFVdfEntry* steam = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp20_;
	ProtonPlusUtilsVDFVdfEntry* _tmp21_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp22_;
	ProtonPlusUtilsVDFVdfEntry* apps = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp25_;
	ProtonPlusUtilsVDFVdfEntry* _tmp26_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp27_;
	ProtonPlusUtilsVDFVdfEntry* app = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp32_;
	ProtonPlusUtilsVDFVdfEntry* _tmp33_;
	ProtonPlusUtilsVDFVdfEntry* field = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp34_;
	ProtonPlusUtilsVDFVdfEntry* _tmp35_;
	const gchar* _tmp36_ = NULL;
	gboolean _tmp37_ = FALSE;
	ProtonPlusUtilsVDFVdfEntry* _tmp38_;
	gchar* _tmp45_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	_tmp0_ = proton_plus_utils_vdf_vdf_parser_parse_document (content);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (doc);
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp4_, "UserLocalConfigStore");
	root = _tmp5_;
	_tmp7_ = root;
	if (_tmp7_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp8_;
		ProtonPlusUtilsVDFVdfEntry* _tmp9_;
		_tmp8_ = root;
		_tmp9_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp8_, "Software");
		_g_object_unref0 (_tmp6_);
		_tmp6_ = _tmp9_;
	} else {
		_g_object_unref0 (_tmp6_);
		_tmp6_ = NULL;
	}
	_tmp10_ = _tmp6_;
	_tmp6_ = NULL;
	software = _tmp10_;
	_tmp12_ = software;
	if (_tmp12_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp13_;
		ProtonPlusUtilsVDFVdfEntry* _tmp14_;
		_tmp13_ = software;
		_tmp14_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp13_, "Valve");
		_g_object_unref0 (_tmp11_);
		_tmp11_ = _tmp14_;
	} else {
		_g_object_unref0 (_tmp11_);
		_tmp11_ = NULL;
	}
	_tmp15_ = _tmp11_;
	_tmp11_ = NULL;
	valve = _tmp15_;
	_tmp17_ = valve;
	if (_tmp17_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp18_;
		ProtonPlusUtilsVDFVdfEntry* _tmp19_;
		_tmp18_ = valve;
		_tmp19_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp18_, "Steam");
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp19_;
	} else {
		_g_object_unref0 (_tmp16_);
		_tmp16_ = NULL;
	}
	_tmp20_ = _tmp16_;
	_tmp16_ = NULL;
	steam = _tmp20_;
	_tmp22_ = steam;
	if (_tmp22_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp23_;
		ProtonPlusUtilsVDFVdfEntry* _tmp24_;
		_tmp23_ = steam;
		_tmp24_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp23_, "apps");
		_g_object_unref0 (_tmp21_);
		_tmp21_ = _tmp24_;
	} else {
		_g_object_unref0 (_tmp21_);
		_tmp21_ = NULL;
	}
	_tmp25_ = _tmp21_;
	_tmp21_ = NULL;
	apps = _tmp25_;
	_tmp27_ = apps;
	if (_tmp27_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		ProtonPlusUtilsVDFVdfEntry* _tmp31_;
		_tmp28_ = apps;
		_tmp29_ = g_strdup_printf ("%u", appid);
		_tmp30_ = _tmp29_;
		_tmp31_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp28_, _tmp30_);
		_g_object_unref0 (_tmp26_);
		_tmp26_ = _tmp31_;
		_g_free0 (_tmp30_);
	} else {
		_g_object_unref0 (_tmp26_);
		_tmp26_ = NULL;
	}
	_tmp32_ = _tmp26_;
	_tmp26_ = NULL;
	app = _tmp32_;
	_tmp33_ = app;
	if (_tmp33_ == NULL) {
		result = NULL;
		_g_object_unref0 (app);
		_g_object_unref0 (_tmp26_);
		_g_object_unref0 (apps);
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp34_ = app;
	_tmp35_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp34_, "LaunchOptions");
	field = _tmp35_;
	_tmp38_ = field;
	if (_tmp38_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp39_;
		const gchar* _tmp40_;
		const gchar* _tmp41_;
		_tmp39_ = field;
		_tmp40_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp37_ = _tmp41_ != NULL;
	} else {
		_tmp37_ = FALSE;
	}
	if (_tmp37_) {
		ProtonPlusUtilsVDFVdfEntry* _tmp42_;
		const gchar* _tmp43_;
		const gchar* _tmp44_;
		_tmp42_ = field;
		_tmp43_ = proton_plus_utils_vdf_vdf_entry_get_value (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp36_ = _tmp44_;
	} else {
		_tmp36_ = PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT;
	}
	_tmp45_ = g_strdup (_tmp36_);
	result = _tmp45_;
	_g_object_unref0 (field);
	_g_object_unref0 (app);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (apps);
	_g_object_unref0 (_tmp21_);
	_g_object_unref0 (steam);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (valve);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (software);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (root);
	_g_object_unref0 (doc);
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_same_desired (ProtonPlusServicesSteamConfigurationService* self,
                                                               ProtonPlusModelsSteamConfigurationIntent* first,
                                                               ProtonPlusModelsSteamConfigurationIntent* second)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (first != NULL, FALSE);
	g_return_val_if_fail (second != NULL, FALSE);
	_tmp1_ = proton_plus_models_steam_configuration_intent_get_desired_present (first);
	_tmp2_ = _tmp1_;
	_tmp3_ = proton_plus_models_steam_configuration_intent_get_desired_present (second);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == _tmp4_) {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp5_ = proton_plus_models_steam_configuration_intent_get_desired (first);
		_tmp6_ = _tmp5_;
		_tmp7_ = proton_plus_models_steam_configuration_intent_get_desired (second);
		_tmp8_ = _tmp7_;
		_tmp0_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_matches_desired (ProtonPlusServicesSteamConfigurationService* self,
                                                                  ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                  const gchar* value)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (intent != NULL, FALSE);
	if (value != NULL) {
		gboolean _tmp1_ = FALSE;
		if (g_strcmp0 (value, PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT) == 0) {
			gboolean _tmp2_;
			gboolean _tmp3_;
			_tmp2_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
			_tmp3_ = _tmp2_;
			_tmp1_ = !_tmp3_;
		} else {
			gboolean _tmp4_ = FALSE;
			gboolean _tmp5_;
			gboolean _tmp6_;
			_tmp5_ = proton_plus_models_steam_configuration_intent_get_desired_present (intent);
			_tmp6_ = _tmp5_;
			if (_tmp6_) {
				const gchar* _tmp7_;
				const gchar* _tmp8_;
				_tmp7_ = proton_plus_models_steam_configuration_intent_get_desired (intent);
				_tmp8_ = _tmp7_;
				_tmp4_ = g_strcmp0 (value, _tmp8_) == 0;
			} else {
				_tmp4_ = FALSE;
			}
			_tmp1_ = _tmp4_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_services_steam_configuration_service_matches_baseline (ProtonPlusServicesSteamConfigurationService* self,
                                                                   ProtonPlusModelsSteamConfigurationIntent* intent,
                                                                   const gchar* value)
{
	gboolean present = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gboolean _tmp16_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (intent != NULL, FALSE);
	if (value == NULL) {
		result = FALSE;
		return result;
	}
	present = g_strcmp0 (value, PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_SERVICE_ABSENT) != 0;
	_tmp1_ = proton_plus_models_steam_configuration_intent_get_baseline (intent);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "") != 0) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = proton_plus_models_steam_configuration_intent_get_baseline_present (intent);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	}
	if (_tmp0_) {
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp6_ = proton_plus_models_steam_configuration_intent_get_baseline_present (intent);
		_tmp7_ = _tmp6_;
		if (present == _tmp7_) {
			gboolean _tmp8_ = FALSE;
			if (!present) {
				_tmp8_ = TRUE;
			} else {
				const gchar* _tmp9_;
				const gchar* _tmp10_;
				_tmp9_ = proton_plus_models_steam_configuration_intent_get_baseline (intent);
				_tmp10_ = _tmp9_;
				_tmp8_ = g_strcmp0 (value, _tmp10_) == 0;
			}
			_tmp5_ = _tmp8_;
		} else {
			_tmp5_ = FALSE;
		}
		result = _tmp5_;
		return result;
	}
	if (present) {
		_tmp11_ = value;
	} else {
		_tmp11_ = "";
	}
	_tmp12_ = proton_plus_models_steam_configuration_intent_fingerprint (_tmp11_, present);
	_tmp13_ = _tmp12_;
	_tmp14_ = proton_plus_models_steam_configuration_intent_get_baseline_fingerprint (intent);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strcmp0 (_tmp13_, _tmp15_) == 0;
	_g_free0 (_tmp13_);
	result = _tmp16_;
	return result;
}

static gchar*
proton_plus_services_steam_configuration_service_mutate_compatibility (ProtonPlusServicesSteamConfigurationService* self,
                                                                       const gchar* content,
                                                                       guint appid,
                                                                       const gchar* desired,
                                                                       gboolean desired_present)
{
	ProtonPlusUtilsVDFVdfDocument* doc = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp0_;
	ProtonPlusUtilsVDFVdfDocument* _tmp1_;
	ProtonPlusUtilsVDFVdfEntry* root = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp2_;
	ProtonPlusUtilsVDFVdfEntry* _tmp3_;
	ProtonPlusUtilsVDFVdfEntry* _tmp4_;
	ProtonPlusUtilsVDFVdfEntry* _tmp5_;
	ProtonPlusUtilsVDFVdfEntry* _tmp6_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp7_;
	ProtonPlusUtilsVDFVdfEntry* software = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* valve = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp15_;
	ProtonPlusUtilsVDFVdfEntry* _tmp16_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp17_;
	ProtonPlusUtilsVDFVdfEntry* steam = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp20_;
	gboolean _tmp21_ = FALSE;
	ProtonPlusUtilsVDFVdfEntry* _tmp22_;
	ProtonPlusUtilsVDFVdfEntry* mapping = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp26_;
	ProtonPlusUtilsVDFVdfEntry* _tmp27_;
	gboolean _tmp28_ = FALSE;
	ProtonPlusUtilsVDFVdfEntry* _tmp29_;
	ProtonPlusUtilsVDFVdfEntry* _tmp75_;
	ProtonPlusUtilsVDFVdfEntry* entry = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp77_;
	gchar* _tmp78_;
	gchar* _tmp79_;
	ProtonPlusUtilsVDFVdfEntry* _tmp80_;
	ProtonPlusUtilsVDFVdfEntry* _tmp81_;
	ProtonPlusUtilsVDFVdfEntry* _tmp89_;
	gchar* i = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp98_;
	ProtonPlusUtilsVDFVdfEntry* _tmp99_;
	gchar* _tmp100_;
	gchar* e = NULL;
	const gchar* _tmp101_;
	gchar* _tmp102_;
	const gchar* _tmp103_ = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp104_;
	ProtonPlusUtilsVDFVdfEntry* _tmp105_;
	const gchar* _tmp106_;
	const gchar* _tmp107_;
	const gchar* _tmp108_;
	gchar* _tmp109_;
	gchar* _tmp110_;
	const gchar* _tmp111_;
	const gchar* _tmp112_;
	const gchar* _tmp113_;
	gchar* _tmp114_;
	gchar* _tmp115_;
	gchar* _tmp116_;
	gchar* _tmp117_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	g_return_val_if_fail (desired != NULL, NULL);
	_tmp0_ = proton_plus_utils_vdf_vdf_parser_parse_document (content);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (doc);
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp4_, "InstallConfigStore");
	root = _tmp5_;
	_tmp7_ = root;
	if (_tmp7_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp8_;
		ProtonPlusUtilsVDFVdfEntry* _tmp9_;
		_tmp8_ = root;
		_tmp9_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp8_, "Software");
		_g_object_unref0 (_tmp6_);
		_tmp6_ = _tmp9_;
	} else {
		_g_object_unref0 (_tmp6_);
		_tmp6_ = NULL;
	}
	_tmp10_ = _tmp6_;
	_tmp6_ = NULL;
	software = _tmp10_;
	_tmp12_ = software;
	if (_tmp12_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp13_;
		ProtonPlusUtilsVDFVdfEntry* _tmp14_;
		_tmp13_ = software;
		_tmp14_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp13_, "Valve");
		_g_object_unref0 (_tmp11_);
		_tmp11_ = _tmp14_;
	} else {
		_g_object_unref0 (_tmp11_);
		_tmp11_ = NULL;
	}
	_tmp15_ = _tmp11_;
	_tmp11_ = NULL;
	valve = _tmp15_;
	_tmp17_ = valve;
	if (_tmp17_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp18_;
		ProtonPlusUtilsVDFVdfEntry* _tmp19_;
		_tmp18_ = valve;
		_tmp19_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp18_, "Steam");
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp19_;
	} else {
		_g_object_unref0 (_tmp16_);
		_tmp16_ = NULL;
	}
	_tmp20_ = _tmp16_;
	_tmp16_ = NULL;
	steam = _tmp20_;
	_tmp22_ = steam;
	if (_tmp22_ == NULL) {
		_tmp21_ = TRUE;
	} else {
		ProtonPlusUtilsVDFVdfEntry* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		_tmp23_ = steam;
		_tmp24_ = proton_plus_utils_vdf_vdf_entry_get_closing_brace_start (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp21_ = _tmp25_ == -1;
	}
	if (_tmp21_) {
		result = NULL;
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp26_ = steam;
	_tmp27_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp26_, "CompatToolMapping");
	mapping = _tmp27_;
	_tmp29_ = mapping;
	if (_tmp29_ == NULL) {
		_tmp28_ = desired_present;
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		gchar* i = NULL;
		ProtonPlusUtilsVDFVdfDocument* _tmp30_;
		ProtonPlusUtilsVDFVdfEntry* _tmp31_;
		gchar* _tmp32_;
		gchar* expanded = NULL;
		ProtonPlusUtilsVDFVdfDocument* _tmp33_;
		ProtonPlusUtilsVDFVdfEntry* _tmp34_;
		const gchar* _tmp35_;
		gchar* _tmp36_;
		gchar* _tmp37_;
		const gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		const gchar* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		const gchar* _tmp48_;
		ProtonPlusUtilsVDFVdfDocument* _tmp49_;
		ProtonPlusUtilsVDFVdfDocument* _tmp50_;
		ProtonPlusUtilsVDFVdfDocument* _tmp51_;
		ProtonPlusUtilsVDFVdfEntry* _tmp52_;
		ProtonPlusUtilsVDFVdfEntry* _tmp53_;
		ProtonPlusUtilsVDFVdfEntry* _tmp54_;
		ProtonPlusUtilsVDFVdfEntry* _tmp55_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp56_;
		ProtonPlusUtilsVDFVdfEntry* _tmp59_;
		ProtonPlusUtilsVDFVdfEntry* _tmp60_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp61_;
		ProtonPlusUtilsVDFVdfEntry* _tmp64_;
		ProtonPlusUtilsVDFVdfEntry* _tmp65_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp66_;
		ProtonPlusUtilsVDFVdfEntry* _tmp69_;
		ProtonPlusUtilsVDFVdfEntry* _tmp70_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp71_;
		ProtonPlusUtilsVDFVdfEntry* _tmp74_;
		_tmp30_ = doc;
		_tmp31_ = steam;
		_tmp32_ = proton_plus_utils_vdf_vdf_document_indentation_of_closing_brace (_tmp30_, _tmp31_);
		i = _tmp32_;
		_tmp33_ = doc;
		_tmp34_ = steam;
		_tmp35_ = i;
		_tmp36_ = g_strconcat (_tmp35_, "\t", NULL);
		_tmp37_ = _tmp36_;
		_tmp38_ = i;
		_tmp39_ = g_strconcat (_tmp38_, "\t", NULL);
		_tmp40_ = _tmp39_;
		_tmp41_ = i;
		_tmp42_ = g_strconcat (_tmp41_, "\t", NULL);
		_tmp43_ = _tmp42_;
		_tmp44_ = g_strdup_printf ("%s\"CompatToolMapping\"\n%s{\n%s}\n", _tmp37_, _tmp40_, _tmp43_);
		_tmp45_ = _tmp44_;
		_tmp46_ = proton_plus_utils_vdf_vdf_document_insert_before_closing_brace (_tmp33_, _tmp34_, _tmp45_);
		_tmp47_ = _tmp46_;
		_g_free0 (_tmp45_);
		_g_free0 (_tmp43_);
		_g_free0 (_tmp40_);
		_g_free0 (_tmp37_);
		expanded = _tmp47_;
		_tmp48_ = expanded;
		_tmp49_ = proton_plus_utils_vdf_vdf_parser_parse_document (_tmp48_);
		_g_object_unref0 (doc);
		doc = _tmp49_;
		_tmp50_ = doc;
		if (_tmp50_ == NULL) {
			result = NULL;
			_g_free0 (expanded);
			_g_free0 (i);
			_g_object_unref0 (mapping);
			_g_object_unref0 (steam);
			_g_object_unref0 (_tmp16_);
			_g_object_unref0 (valve);
			_g_object_unref0 (_tmp11_);
			_g_object_unref0 (software);
			_g_object_unref0 (_tmp6_);
			_g_object_unref0 (root);
			_g_object_unref0 (doc);
			return result;
		}
		_tmp51_ = doc;
		_tmp52_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp53_, "InstallConfigStore");
		_g_object_unref0 (root);
		root = _tmp54_;
		_tmp56_ = root;
		if (_tmp56_ != NULL) {
			ProtonPlusUtilsVDFVdfEntry* _tmp57_;
			ProtonPlusUtilsVDFVdfEntry* _tmp58_;
			_tmp57_ = root;
			_tmp58_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp57_, "Software");
			_g_object_unref0 (_tmp55_);
			_tmp55_ = _tmp58_;
		} else {
			_g_object_unref0 (_tmp55_);
			_tmp55_ = NULL;
		}
		_tmp59_ = _tmp55_;
		_tmp55_ = NULL;
		_g_object_unref0 (software);
		software = _tmp59_;
		_tmp61_ = software;
		if (_tmp61_ != NULL) {
			ProtonPlusUtilsVDFVdfEntry* _tmp62_;
			ProtonPlusUtilsVDFVdfEntry* _tmp63_;
			_tmp62_ = software;
			_tmp63_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp62_, "Valve");
			_g_object_unref0 (_tmp60_);
			_tmp60_ = _tmp63_;
		} else {
			_g_object_unref0 (_tmp60_);
			_tmp60_ = NULL;
		}
		_tmp64_ = _tmp60_;
		_tmp60_ = NULL;
		_g_object_unref0 (valve);
		valve = _tmp64_;
		_tmp66_ = valve;
		if (_tmp66_ != NULL) {
			ProtonPlusUtilsVDFVdfEntry* _tmp67_;
			ProtonPlusUtilsVDFVdfEntry* _tmp68_;
			_tmp67_ = valve;
			_tmp68_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp67_, "Steam");
			_g_object_unref0 (_tmp65_);
			_tmp65_ = _tmp68_;
		} else {
			_g_object_unref0 (_tmp65_);
			_tmp65_ = NULL;
		}
		_tmp69_ = _tmp65_;
		_tmp65_ = NULL;
		_g_object_unref0 (steam);
		steam = _tmp69_;
		_tmp71_ = steam;
		if (_tmp71_ != NULL) {
			ProtonPlusUtilsVDFVdfEntry* _tmp72_;
			ProtonPlusUtilsVDFVdfEntry* _tmp73_;
			_tmp72_ = steam;
			_tmp73_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp72_, "CompatToolMapping");
			_g_object_unref0 (_tmp70_);
			_tmp70_ = _tmp73_;
		} else {
			_g_object_unref0 (_tmp70_);
			_tmp70_ = NULL;
		}
		_tmp74_ = _tmp70_;
		_tmp70_ = NULL;
		_g_object_unref0 (mapping);
		mapping = _tmp74_;
		_g_object_unref0 (_tmp70_);
		_g_object_unref0 (_tmp65_);
		_g_object_unref0 (_tmp60_);
		_g_object_unref0 (_tmp55_);
		_g_free0 (expanded);
		_g_free0 (i);
	}
	_tmp75_ = mapping;
	if (_tmp75_ == NULL) {
		gchar* _tmp76_;
		_tmp76_ = g_strdup (content);
		result = _tmp76_;
		_g_object_unref0 (mapping);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp77_ = mapping;
	_tmp78_ = g_strdup_printf ("%u", appid);
	_tmp79_ = _tmp78_;
	_tmp80_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp77_, _tmp79_);
	_tmp81_ = _tmp80_;
	_g_free0 (_tmp79_);
	entry = _tmp81_;
	if (!desired_present) {
		gchar* _tmp82_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp83_;
		gchar* _tmp88_;
		_tmp83_ = entry;
		if (_tmp83_ != NULL) {
			ProtonPlusUtilsVDFVdfDocument* _tmp84_;
			ProtonPlusUtilsVDFVdfEntry* _tmp85_;
			gchar* _tmp86_;
			_tmp84_ = doc;
			_tmp85_ = entry;
			_tmp86_ = proton_plus_utils_vdf_vdf_document_remove_entry (_tmp84_, _tmp85_);
			_g_free0 (_tmp82_);
			_tmp82_ = _tmp86_;
		} else {
			gchar* _tmp87_;
			_tmp87_ = g_strdup (content);
			_g_free0 (_tmp82_);
			_tmp82_ = _tmp87_;
		}
		_tmp88_ = _tmp82_;
		_tmp82_ = NULL;
		result = _tmp88_;
		_g_free0 (_tmp82_);
		_g_object_unref0 (entry);
		_g_object_unref0 (mapping);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp89_ = entry;
	if (_tmp89_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* name = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp90_;
		ProtonPlusUtilsVDFVdfEntry* _tmp91_;
		gchar* _tmp92_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp93_;
		gchar* _tmp97_;
		_tmp90_ = entry;
		_tmp91_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp90_, "name");
		name = _tmp91_;
		_tmp93_ = name;
		if (_tmp93_ != NULL) {
			ProtonPlusUtilsVDFVdfDocument* _tmp94_;
			ProtonPlusUtilsVDFVdfEntry* _tmp95_;
			gchar* _tmp96_;
			_tmp94_ = doc;
			_tmp95_ = name;
			_tmp96_ = proton_plus_utils_vdf_vdf_document_replace_value (_tmp94_, _tmp95_, desired);
			_g_free0 (_tmp92_);
			_tmp92_ = _tmp96_;
		} else {
			_g_free0 (_tmp92_);
			_tmp92_ = NULL;
		}
		_tmp97_ = _tmp92_;
		_tmp92_ = NULL;
		result = _tmp97_;
		_g_free0 (_tmp92_);
		_g_object_unref0 (name);
		_g_object_unref0 (entry);
		_g_object_unref0 (mapping);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp98_ = doc;
	_tmp99_ = mapping;
	_tmp100_ = proton_plus_utils_vdf_vdf_document_indentation_of_closing_brace (_tmp98_, _tmp99_);
	i = _tmp100_;
	_tmp101_ = i;
	_tmp102_ = g_strconcat (_tmp101_, "\t", NULL);
	e = _tmp102_;
	if (appid == ((guint) 0)) {
		_tmp103_ = "75";
	} else {
		_tmp103_ = "250";
	}
	_tmp104_ = doc;
	_tmp105_ = mapping;
	_tmp106_ = e;
	_tmp107_ = e;
	_tmp108_ = e;
	_tmp109_ = proton_plus_utils_vdf_vdf_document_quote (desired);
	_tmp110_ = _tmp109_;
	_tmp111_ = e;
	_tmp112_ = e;
	_tmp113_ = e;
	_tmp114_ = g_strdup_printf ("%s\"%u\"\n" \
"%s{\n" \
"%s\t\"name\"\t\t%s\n" \
"%s\t\"config\"\t\t\"\"\n" \
"%s\t\"priority\"\t\t\"%s\"\n" \
"%s}\n", _tmp106_, appid, _tmp107_, _tmp108_, _tmp110_, _tmp111_, _tmp112_, _tmp103_, _tmp113_);
	_tmp115_ = _tmp114_;
	_tmp116_ = proton_plus_utils_vdf_vdf_document_insert_before_closing_brace (_tmp104_, _tmp105_, _tmp115_);
	_tmp117_ = _tmp116_;
	_g_free0 (_tmp115_);
	_g_free0 (_tmp110_);
	result = _tmp117_;
	_g_free0 (e);
	_g_free0 (i);
	_g_object_unref0 (entry);
	_g_object_unref0 (mapping);
	_g_object_unref0 (steam);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (valve);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (software);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (root);
	_g_object_unref0 (doc);
	return result;
}

static gchar*
proton_plus_services_steam_configuration_service_mutate_launch (ProtonPlusServicesSteamConfigurationService* self,
                                                                const gchar* content,
                                                                guint appid,
                                                                const gchar* desired,
                                                                gboolean desired_present)
{
	ProtonPlusUtilsVDFVdfDocument* doc = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp0_;
	ProtonPlusUtilsVDFVdfDocument* _tmp1_;
	ProtonPlusUtilsVDFVdfEntry* root = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp2_;
	ProtonPlusUtilsVDFVdfEntry* _tmp3_;
	ProtonPlusUtilsVDFVdfEntry* _tmp4_;
	ProtonPlusUtilsVDFVdfEntry* _tmp5_;
	ProtonPlusUtilsVDFVdfEntry* _tmp6_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp7_;
	ProtonPlusUtilsVDFVdfEntry* software = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp10_;
	ProtonPlusUtilsVDFVdfEntry* _tmp11_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp12_;
	ProtonPlusUtilsVDFVdfEntry* valve = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp15_;
	ProtonPlusUtilsVDFVdfEntry* _tmp16_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp17_;
	ProtonPlusUtilsVDFVdfEntry* steam = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp20_;
	ProtonPlusUtilsVDFVdfEntry* _tmp21_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp22_;
	ProtonPlusUtilsVDFVdfEntry* apps = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp25_;
	ProtonPlusUtilsVDFVdfEntry* _tmp26_ = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp27_;
	ProtonPlusUtilsVDFVdfEntry* app = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp32_;
	gboolean _tmp33_ = FALSE;
	ProtonPlusUtilsVDFVdfEntry* _tmp34_;
	ProtonPlusUtilsVDFVdfEntry* field = NULL;
	ProtonPlusUtilsVDFVdfEntry* _tmp38_;
	ProtonPlusUtilsVDFVdfEntry* _tmp39_;
	ProtonPlusUtilsVDFVdfEntry* _tmp47_;
	gchar* i = NULL;
	ProtonPlusUtilsVDFVdfDocument* _tmp51_;
	ProtonPlusUtilsVDFVdfEntry* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	ProtonPlusUtilsVDFVdfDocument* _tmp57_;
	ProtonPlusUtilsVDFVdfEntry* _tmp58_;
	const gchar* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	g_return_val_if_fail (desired != NULL, NULL);
	_tmp0_ = proton_plus_utils_vdf_vdf_parser_parse_document (content);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (doc);
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = proton_plus_utils_vdf_vdf_document_get_root (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp4_, "UserLocalConfigStore");
	root = _tmp5_;
	_tmp7_ = root;
	if (_tmp7_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp8_;
		ProtonPlusUtilsVDFVdfEntry* _tmp9_;
		_tmp8_ = root;
		_tmp9_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp8_, "Software");
		_g_object_unref0 (_tmp6_);
		_tmp6_ = _tmp9_;
	} else {
		_g_object_unref0 (_tmp6_);
		_tmp6_ = NULL;
	}
	_tmp10_ = _tmp6_;
	_tmp6_ = NULL;
	software = _tmp10_;
	_tmp12_ = software;
	if (_tmp12_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp13_;
		ProtonPlusUtilsVDFVdfEntry* _tmp14_;
		_tmp13_ = software;
		_tmp14_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp13_, "Valve");
		_g_object_unref0 (_tmp11_);
		_tmp11_ = _tmp14_;
	} else {
		_g_object_unref0 (_tmp11_);
		_tmp11_ = NULL;
	}
	_tmp15_ = _tmp11_;
	_tmp11_ = NULL;
	valve = _tmp15_;
	_tmp17_ = valve;
	if (_tmp17_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp18_;
		ProtonPlusUtilsVDFVdfEntry* _tmp19_;
		_tmp18_ = valve;
		_tmp19_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp18_, "Steam");
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp19_;
	} else {
		_g_object_unref0 (_tmp16_);
		_tmp16_ = NULL;
	}
	_tmp20_ = _tmp16_;
	_tmp16_ = NULL;
	steam = _tmp20_;
	_tmp22_ = steam;
	if (_tmp22_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp23_;
		ProtonPlusUtilsVDFVdfEntry* _tmp24_;
		_tmp23_ = steam;
		_tmp24_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp23_, "apps");
		_g_object_unref0 (_tmp21_);
		_tmp21_ = _tmp24_;
	} else {
		_g_object_unref0 (_tmp21_);
		_tmp21_ = NULL;
	}
	_tmp25_ = _tmp21_;
	_tmp21_ = NULL;
	apps = _tmp25_;
	_tmp27_ = apps;
	if (_tmp27_ != NULL) {
		ProtonPlusUtilsVDFVdfEntry* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		ProtonPlusUtilsVDFVdfEntry* _tmp31_;
		_tmp28_ = apps;
		_tmp29_ = g_strdup_printf ("%u", appid);
		_tmp30_ = _tmp29_;
		_tmp31_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp28_, _tmp30_);
		_g_object_unref0 (_tmp26_);
		_tmp26_ = _tmp31_;
		_g_free0 (_tmp30_);
	} else {
		_g_object_unref0 (_tmp26_);
		_tmp26_ = NULL;
	}
	_tmp32_ = _tmp26_;
	_tmp26_ = NULL;
	app = _tmp32_;
	_tmp34_ = app;
	if (_tmp34_ == NULL) {
		_tmp33_ = TRUE;
	} else {
		ProtonPlusUtilsVDFVdfEntry* _tmp35_;
		gint _tmp36_;
		gint _tmp37_;
		_tmp35_ = app;
		_tmp36_ = proton_plus_utils_vdf_vdf_entry_get_closing_brace_start (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp33_ = _tmp37_ == -1;
	}
	if (_tmp33_) {
		result = NULL;
		_g_object_unref0 (app);
		_g_object_unref0 (_tmp26_);
		_g_object_unref0 (apps);
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp38_ = app;
	_tmp39_ = proton_plus_utils_vdf_vdf_entry_get_child (_tmp38_, "LaunchOptions");
	field = _tmp39_;
	if (!desired_present) {
		gchar* _tmp40_ = NULL;
		ProtonPlusUtilsVDFVdfEntry* _tmp41_;
		gchar* _tmp46_;
		_tmp41_ = field;
		if (_tmp41_ != NULL) {
			ProtonPlusUtilsVDFVdfDocument* _tmp42_;
			ProtonPlusUtilsVDFVdfEntry* _tmp43_;
			gchar* _tmp44_;
			_tmp42_ = doc;
			_tmp43_ = field;
			_tmp44_ = proton_plus_utils_vdf_vdf_document_remove_entry (_tmp42_, _tmp43_);
			_g_free0 (_tmp40_);
			_tmp40_ = _tmp44_;
		} else {
			gchar* _tmp45_;
			_tmp45_ = g_strdup (content);
			_g_free0 (_tmp40_);
			_tmp40_ = _tmp45_;
		}
		_tmp46_ = _tmp40_;
		_tmp40_ = NULL;
		result = _tmp46_;
		_g_free0 (_tmp40_);
		_g_object_unref0 (field);
		_g_object_unref0 (app);
		_g_object_unref0 (_tmp26_);
		_g_object_unref0 (apps);
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp47_ = field;
	if (_tmp47_ != NULL) {
		ProtonPlusUtilsVDFVdfDocument* _tmp48_;
		ProtonPlusUtilsVDFVdfEntry* _tmp49_;
		gchar* _tmp50_;
		_tmp48_ = doc;
		_tmp49_ = field;
		_tmp50_ = proton_plus_utils_vdf_vdf_document_replace_value (_tmp48_, _tmp49_, desired);
		result = _tmp50_;
		_g_object_unref0 (field);
		_g_object_unref0 (app);
		_g_object_unref0 (_tmp26_);
		_g_object_unref0 (apps);
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (steam);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (valve);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (software);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (root);
		_g_object_unref0 (doc);
		return result;
	}
	_tmp51_ = doc;
	_tmp52_ = app;
	_tmp53_ = proton_plus_utils_vdf_vdf_document_indentation_of_closing_brace (_tmp51_, _tmp52_);
	_tmp54_ = _tmp53_;
	_tmp55_ = g_strconcat (_tmp54_, "\t", NULL);
	_tmp56_ = _tmp55_;
	_g_free0 (_tmp54_);
	i = _tmp56_;
	_tmp57_ = doc;
	_tmp58_ = app;
	_tmp59_ = i;
	_tmp60_ = proton_plus_utils_vdf_vdf_document_quote (desired);
	_tmp61_ = _tmp60_;
	_tmp62_ = g_strdup_printf ("%s\"LaunchOptions\"\t\t%s\n", _tmp59_, _tmp61_);
	_tmp63_ = _tmp62_;
	_tmp64_ = proton_plus_utils_vdf_vdf_document_insert_before_closing_brace (_tmp57_, _tmp58_, _tmp63_);
	_tmp65_ = _tmp64_;
	_g_free0 (_tmp63_);
	_g_free0 (_tmp61_);
	result = _tmp65_;
	_g_free0 (i);
	_g_object_unref0 (field);
	_g_object_unref0 (app);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (apps);
	_g_object_unref0 (_tmp21_);
	_g_object_unref0 (steam);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (valve);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (software);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (root);
	_g_object_unref0 (doc);
	return result;
}

ProtonPlusServicesSteamConfigurationService*
proton_plus_services_steam_configuration_service_get_instance (void)
{
	ProtonPlusServicesSteamConfigurationService* result;
	ProtonPlusServicesSteamConfigurationService* _tmp0_;
	_tmp0_ = proton_plus_services_steam_configuration_service_configured;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_steam_configuration_service_class_init (ProtonPlusServicesSteamConfigurationServiceClass * klass,
                                                             gpointer klass_data)
{
	proton_plus_services_steam_configuration_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesSteamConfigurationService_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_services_steam_configuration_service_get_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_steam_configuration_service_finalize;
}

static void
proton_plus_services_steam_configuration_service_proton_plus_services_steam_configuration_reconciler_interface_init (ProtonPlusServicesSteamConfigurationReconcilerIface * iface,
                                                                                                                     gpointer iface_data)
{
	proton_plus_services_steam_configuration_service_proton_plus_services_steam_configuration_reconciler_parent_iface = g_type_interface_peek_parent (iface);
	iface->reconcile_target = (ProtonPlusServicesSteamConfigurationMutation* (*) (ProtonPlusServicesSteamConfigurationReconciler*, ProtonPlusModelsSteamRestartTarget*)) proton_plus_services_steam_configuration_service_real_reconcile_target;
	iface->verify_target_after_session = (gboolean (*) (ProtonPlusServicesSteamConfigurationReconciler*, ProtonPlusModelsSteamRestartTarget*)) proton_plus_services_steam_configuration_service_real_verify_target_after_session;
}

static void
proton_plus_services_steam_configuration_service_instance_init (ProtonPlusServicesSteamConfigurationService * self,
                                                                gpointer klass)
{
	self->priv = proton_plus_services_steam_configuration_service_get_instance_private (self);
}

static void
proton_plus_services_steam_configuration_service_finalize (GObject * obj)
{
	ProtonPlusServicesSteamConfigurationService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, ProtonPlusServicesSteamConfigurationService);
	_g_object_unref0 (self->priv->sessions);
	_g_object_unref0 (self->priv->manager);
	_g_object_unref0 (self->priv->shortcut_mutator);
	G_OBJECT_CLASS (proton_plus_services_steam_configuration_service_parent_class)->finalize (obj);
}

static GType
proton_plus_services_steam_configuration_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesSteamConfigurationServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_steam_configuration_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesSteamConfigurationService), 0, (GInstanceInitFunc) proton_plus_services_steam_configuration_service_instance_init, NULL };
	static const GInterfaceInfo proton_plus_services_steam_configuration_reconciler_info = { (GInterfaceInitFunc) proton_plus_services_steam_configuration_service_proton_plus_services_steam_configuration_reconciler_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_services_steam_configuration_service_type_id;
	proton_plus_services_steam_configuration_service_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesSteamConfigurationService", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_services_steam_configuration_service_type_id, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_RECONCILER, &proton_plus_services_steam_configuration_reconciler_info);
	ProtonPlusServicesSteamConfigurationService_private_offset = g_type_add_instance_private (proton_plus_services_steam_configuration_service_type_id, sizeof (ProtonPlusServicesSteamConfigurationServicePrivate));
	return proton_plus_services_steam_configuration_service_type_id;
}

GType
proton_plus_services_steam_configuration_service_get_type (void)
{
	static volatile gsize proton_plus_services_steam_configuration_service_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_configuration_service_type_id__once)) {
		GType proton_plus_services_steam_configuration_service_type_id;
		proton_plus_services_steam_configuration_service_type_id = proton_plus_services_steam_configuration_service_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_configuration_service_type_id__once, proton_plus_services_steam_configuration_service_type_id);
	}
	return proton_plus_services_steam_configuration_service_type_id__once;
}

static void
_vala_proton_plus_services_steam_configuration_service_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec)
{
	ProtonPlusServicesSteamConfigurationService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, ProtonPlusServicesSteamConfigurationService);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

