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

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

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

enum  {
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_0_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_IS_OPERATION_ACTIVE_PROPERTY,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusServicesSteamRestartOrchestratorRestartTargetData ProtonPlusServicesSteamRestartOrchestratorRestartTargetData;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ProtonPlusServicesSteamRestartOrchestratorRunData ProtonPlusServicesSteamRestartOrchestratorRunData;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData;
typedef struct _Block66Data Block66Data;
typedef struct _ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData;
enum  {
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_CHANGED_SIGNAL,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_PROGRESS_CHANGED_SIGNAL,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_OPERATION_COMPLETED_SIGNAL,
	PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_NUM_SIGNALS
};
static guint proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_NUM_SIGNALS] = {0};

struct _ProtonPlusServicesSteamRestartOrchestratorPrivate {
	ProtonPlusServicesSteamSessionService* session_service;
	ProtonPlusServicesSteamRestartManager* restart_manager;
	ProtonPlusServicesSteamRestartBackend* backend;
	ProtonPlusServicesSteamConfigurationReconciler* configuration_reconciler;
	guint poll_interval_msec;
	guint exit_poll_limit;
	guint start_poll_limit;
	gboolean operation_active;
	ProtonPlusModelsSteamRestartOperationState _state;
	ProtonPlusServicesSteamSessionSnapshot* _last_snapshot;
};

struct _ProtonPlusServicesSteamRestartOrchestratorRestartTargetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	GObject* cancellation;
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamSessionSnapshot* _tmp0_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* completed;
	ProtonPlusModelsSteamRestartOperationResult* _tmp2_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp3_;
	GError* _inner_error0_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	GObject* cancellation;
	ProtonPlusModelsSteamRestartOperationResult* result;
	GCancellable* cancellable;
	GCancellable* _tmp0_;
	gboolean shutdown_sent;
	gboolean stopped;
	gboolean launch_sent;
	gboolean started;
	GCancellable* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp2_;
	ProtonPlusServicesSteamRestartManager* _tmp3_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp4_;
	ProtonPlusServicesSteamSessionSnapshot* preflight;
	ProtonPlusServicesSteamSessionSnapshot* _tmp5_;
	gboolean steamos_handoff;
	ProtonPlusServicesSteamSessionSnapshot* _tmp6_;
	ProtonPlusServicesSteamSessionMode _tmp7_;
	ProtonPlusServicesSteamSessionMode _tmp8_;
	ProtonPlusModelsSteamRestartFailureReason preflight_reason;
	ProtonPlusServicesSteamSessionSnapshot* _tmp9_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp10_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp11_;
	GCancellable* _tmp12_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp13_;
	ProtonPlusModelsSteamSessionIdentity* _tmp14_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp15_;
	ProtonPlusModelsSteamSessionIdentity* _tmp16_;
	ProtonPlusModelsSteamSessionIdentity* _tmp17_;
	ProtonPlusModelsSteamSessionIdentity* original_identity;
	ProtonPlusModelsSteamSessionIdentity* _tmp18_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp19_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp20_;
	ProtonPlusModelsSteamSessionIdentity* _tmp21_;
	GCancellable* _tmp22_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp23_;
	ProtonPlusServicesSteamSessionSnapshot* dispatch_snapshot;
	ProtonPlusServicesSteamSessionSnapshot* _tmp24_;
	ProtonPlusModelsSteamRestartFailureReason dispatch_reason;
	ProtonPlusServicesSteamSessionSnapshot* _tmp25_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp26_;
	ProtonPlusModelsSteamSessionIdentity* _tmp27_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp28_;
	ProtonPlusModelsSteamSessionIdentity* _tmp29_;
	ProtonPlusModelsSteamSessionIdentity* _tmp30_;
	gboolean _tmp31_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp32_;
	GCancellable* _tmp33_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp34_;
	ProtonPlusServicesSteamRestartCommandResult* shutdown;
	GCancellable* _tmp35_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp36_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp37_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp38_;
	ProtonPlusServicesSteamRestartCommandResult* shutdown_result;
	ProtonPlusServicesSteamRestartCommandResult* _tmp39_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp40_;
	gboolean _tmp41_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp42_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp43_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp44_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp45_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp46_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp47_;
	gboolean _tmp48_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp49_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp50_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp51_;
	GCancellable* _tmp52_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp58_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp59_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp60_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp61_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp62_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp63_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp66_;
	guint poll;
	gboolean _tmp67_;
	guint _tmp68_;
	GCancellable* _tmp69_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp70_;
	ProtonPlusServicesSteamSessionSnapshot* observed;
	ProtonPlusServicesSteamSessionSnapshot* _tmp71_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp72_;
	ProtonPlusModelsSteamSessionIdentity* _tmp73_;
	GCancellable* _tmp74_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp75_;
	gboolean _tmp76_;
	gboolean _tmp77_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp78_;
	ProtonPlusServicesSteamSessionState _tmp79_;
	ProtonPlusServicesSteamSessionState _tmp80_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp81_;
	ProtonPlusServicesSteamSessionState _tmp82_;
	ProtonPlusServicesSteamSessionState _tmp83_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp84_;
	ProtonPlusServicesSteamSessionState _tmp85_;
	ProtonPlusServicesSteamSessionState _tmp86_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp87_;
	ProtonPlusServicesSteamRestartBackend* _tmp88_;
	GCancellable* _tmp89_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp90_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp91_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	ProtonPlusServicesSteamSessionSnapshot* preflight;
	GCancellable* cancellable;
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusModelsSteamInstallationKind _tmp0_;
	ProtonPlusModelsSteamInstallationKind _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp2_;
	ProtonPlusModelsSteamSessionIdentity* original_identity;
	ProtonPlusModelsSteamSessionIdentity* _tmp3_;
	gboolean _tmp4_;
	ProtonPlusServicesSteamSessionState _tmp5_;
	ProtonPlusServicesSteamSessionState _tmp6_;
	ProtonPlusModelsSteamSessionIdentity* _tmp7_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp8_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp9_;
	ProtonPlusServicesSteamSessionSnapshot* dispatch_snapshot;
	ProtonPlusServicesSteamSessionSnapshot* _tmp10_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp11_;
	ProtonPlusServicesSteamSessionMode _tmp12_;
	ProtonPlusServicesSteamSessionMode _tmp13_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp14_;
	ProtonPlusModelsSteamRestartFailureReason dispatch_reason;
	ProtonPlusServicesSteamSessionSnapshot* _tmp15_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp16_;
	ProtonPlusModelsSteamSessionIdentity* _tmp17_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp18_;
	ProtonPlusModelsSteamSessionIdentity* _tmp19_;
	ProtonPlusModelsSteamSessionIdentity* _tmp20_;
	gboolean _tmp21_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp22_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp23_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp24_;
	ProtonPlusServicesSteamRestartCommandResult* shutdown;
	ProtonPlusServicesSteamRestartBackend* _tmp25_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp26_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp27_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp28_;
	ProtonPlusServicesSteamRestartCommandResult* shutdown_result;
	ProtonPlusServicesSteamRestartCommandResult* _tmp29_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp30_;
	gboolean _tmp31_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp32_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp33_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp34_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp35_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp36_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp37_;
	gboolean shutdown_sent;
	ProtonPlusServicesSteamRestartCommandResult* _tmp38_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp39_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp40_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp46_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp47_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp48_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp49_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp50_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp54_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp55_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp56_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	ProtonPlusModelsSteamSessionIdentity* original_identity;
	gboolean shutdown_sent;
	gboolean stopped;
	GCancellable* cancellable;
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusModelsSteamRestartOperationResult* _tmp0_;
	gboolean _tmp1_;
	ProtonPlusServicesSteamConfigurationReconciler* _tmp2_;
	ProtonPlusServicesSteamConfigurationMutation* outcome;
	ProtonPlusServicesSteamConfigurationReconciler* _tmp3_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp7_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp8_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp9_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp10_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp11_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp12_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp13_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp14_;
	ProtonPlusServicesSteamConfigurationMutationResult _tmp15_;
	const gchar* _tmp16_;
	ProtonPlusServicesSteamConfigurationMutation* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp20_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp21_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp22_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	ProtonPlusModelsSteamSessionIdentity* original_identity;
	gboolean shutdown_sent;
	gboolean stopped;
	GObject* cancellation;
	ProtonPlusModelsSteamRestartOperationResult* result;
	GCancellable* cancellable;
	GCancellable* _tmp0_;
	gboolean launch_sent;
	gboolean started;
	GCancellable* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp2_;
	ProtonPlusServicesSteamRestartCommandResult* launch;
	GCancellable* _tmp3_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp4_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp5_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp6_;
	ProtonPlusServicesSteamRestartCommandResult* launch_result;
	ProtonPlusServicesSteamRestartCommandResult* _tmp7_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp8_;
	gboolean _tmp9_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp10_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp11_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp12_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp13_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp14_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp15_;
	gboolean _tmp16_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp17_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp18_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp19_;
	GCancellable* _tmp20_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp26_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp27_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp28_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp29_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp30_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp34_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp35_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp36_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp37_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp41_;
	gboolean update_observed;
	gboolean update_relaunch_sent;
	guint poll;
	GCancellable* _tmp42_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp43_;
	ProtonPlusServicesSteamSessionSnapshot* observed;
	ProtonPlusServicesSteamSessionSnapshot* _tmp44_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp45_;
	ProtonPlusServicesSteamSessionState _tmp46_;
	ProtonPlusServicesSteamSessionState _tmp47_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp48_;
	ProtonPlusServicesSteamConfigurationReconciler* _tmp49_;
	ProtonPlusServicesSteamConfigurationReconciler* _tmp50_;
	gboolean cleared;
	ProtonPlusServicesSteamRestartManager* _tmp51_;
	gboolean persistence_failed;
	ProtonPlusServicesSteamRestartManager* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	ProtonPlusModelsSteamRestartFailureReason _tmp55_;
	const gchar* _tmp56_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp57_;
	ProtonPlusModelsSteamRestartFailureReason _tmp58_;
	const gchar* _tmp59_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp60_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp61_;
	gboolean _tmp62_;
	gboolean _tmp63_;
	gboolean _tmp64_;
	ProtonPlusModelsSteamInstallationKind _tmp65_;
	ProtonPlusModelsSteamInstallationKind _tmp66_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp67_;
	ProtonPlusServicesSteamRestartCommandResult* retry;
	GCancellable* _tmp68_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp69_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp70_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp71_;
	ProtonPlusServicesSteamRestartCommandResult* retry_result;
	ProtonPlusServicesSteamRestartCommandResult* _tmp72_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp73_;
	gboolean _tmp74_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp75_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp76_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp77_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp78_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp79_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp80_;
	gboolean _tmp81_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp82_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp83_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp84_;
	GCancellable* _tmp85_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	gchar* _tmp89_;
	gchar* _tmp90_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp91_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp92_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp93_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp94_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp95_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp96_;
	const gchar* _tmp97_;
	const gchar* _tmp98_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp99_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp100_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp101_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp102_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp103_;
	const gchar* _tmp104_;
	const gchar* _tmp105_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp106_;
	ProtonPlusServicesSteamRestartBackend* _tmp107_;
	GCancellable* _tmp108_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp109_;
	guint _tmp110_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp111_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	GCancellable* cancellable;
	ProtonPlusServicesSteamRestartCommandResult* result;
	ProtonPlusServicesSteamRestartCommandResult* launch;
	ProtonPlusModelsSteamInstallationKind _tmp0_;
	ProtonPlusModelsSteamInstallationKind _tmp1_;
	ProtonPlusServicesSteamRestartBackend* _tmp2_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp3_;
	gboolean _tmp4_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp5_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp6_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp7_;
	ProtonPlusServicesSteamRestartCommandStatus _tmp8_;
	ProtonPlusServicesSteamRestartBackend* _tmp9_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp10_;
	ProtonPlusServicesSteamRestartBackend* _tmp11_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp12_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp13_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	ProtonPlusModelsSteamRestartTarget* target;
	GCancellable* cancellable;
	ProtonPlusServicesSteamRestartCommandResult* result;
	ProtonPlusModelsSteamInstallationKind _tmp0_;
	ProtonPlusModelsSteamInstallationKind _tmp1_;
	ProtonPlusServicesSteamRestartBackend* _tmp2_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp3_;
	ProtonPlusServicesSteamRestartBackend* _tmp4_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp5_;
	ProtonPlusServicesSteamRestartCommandResult* _tmp6_;
};

struct _Block66Data {
	int _ref_count_;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	gpointer _async_data_;
};

struct _ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesSteamRestartOrchestrator* self;
	Block66Data* _data66_;
};

static gint ProtonPlusServicesSteamRestartOrchestrator_private_offset;
static gpointer proton_plus_services_steam_restart_orchestrator_parent_class = NULL;

static void proton_plus_services_steam_restart_orchestrator_restart_target_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_restart_target_co (ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_result (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                     ProtonPlusModelsSteamRestartTarget* target,
                                                                                                     ProtonPlusModelsSteamRestartOperationState final_state,
                                                                                                     ProtonPlusModelsSteamRestartFailureReason reason,
                                                                                                     gboolean shutdown,
                                                                                                     gboolean stopped,
                                                                                                     gboolean launch,
                                                                                                     gboolean started,
                                                                                                     gboolean cleared,
                                                                                                     gboolean persistence_failed,
                                                                                                     ProtonPlusServicesSteamSessionSnapshot* snapshot,
                                                                                                     const gchar* detail);
static void proton_plus_services_steam_restart_orchestrator_yield_main_context (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                         GAsyncReadyCallback _callback_,
                                                                         gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_yield_main_context_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_restart_target_ready (GObject* source_object,
                                                                           GAsyncResult* _res_,
                                                                           gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_run (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                          ProtonPlusModelsSteamRestartTarget* target,
                                                          GObject* cancellation,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_run_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                         GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_run_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_run_co (ProtonPlusServicesSteamRestartOrchestratorRunData* _data_);
static void proton_plus_services_steam_restart_orchestrator_transition (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                 ProtonPlusModelsSteamRestartOperationState next);
static gboolean proton_plus_services_steam_restart_orchestrator_cancelled (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                    GCancellable* cancellable);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_cancelled_result (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                               ProtonPlusModelsSteamRestartTarget* target,
                                                                                                               gboolean shutdown,
                                                                                                               gboolean stopped,
                                                                                                               gboolean launch,
                                                                                                               gboolean started,
                                                                                                               const gchar* detail);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_fail (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                   ProtonPlusModelsSteamRestartTarget* target,
                                                                                                   ProtonPlusModelsSteamRestartFailureReason reason,
                                                                                                   gboolean shutdown,
                                                                                                   gboolean stopped,
                                                                                                   gboolean launch,
                                                                                                   gboolean started,
                                                                                                   const gchar* detail);
static ProtonPlusServicesSteamSessionSnapshot* proton_plus_services_steam_restart_orchestrator_observe (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                 ProtonPlusModelsSteamRestartTarget* target,
                                                                                                 gboolean reconcile);
static ProtonPlusModelsSteamRestartFailureReason proton_plus_services_steam_restart_orchestrator_reject_preflight (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                            ProtonPlusModelsSteamRestartTarget* target,
                                                                                                            ProtonPlusServicesSteamSessionSnapshot* snapshot,
                                                                                                            gboolean allow_game_processes);
static void proton_plus_services_steam_restart_orchestrator_request_steamos_handoff (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                              ProtonPlusModelsSteamRestartTarget* target,
                                                                              ProtonPlusServicesSteamSessionSnapshot* preflight,
                                                                              GCancellable* cancellable,
                                                                              GAsyncReadyCallback _callback_,
                                                                              gpointer _user_data_);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                                             GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_run_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static ProtonPlusModelsSteamSessionIdentity* proton_plus_services_steam_restart_orchestrator_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                ProtonPlusModelsSteamRestartTarget* target,
                                                                                                ProtonPlusServicesSteamSessionSnapshot* snapshot);
static ProtonPlusModelsSteamSessionIdentity* proton_plus_services_steam_restart_orchestrator_pending_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                        ProtonPlusModelsSteamRestartTarget* target);
static gboolean proton_plus_services_steam_restart_orchestrator_has_relaunch_strategy (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                ProtonPlusModelsSteamRestartTarget* target);
static gboolean proton_plus_services_steam_restart_orchestrator_is_confirmed_stopped (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                               ProtonPlusServicesSteamSessionSnapshot* snapshot);
static void proton_plus_services_steam_restart_orchestrator_reconcile_and_launch (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                           ProtonPlusModelsSteamRestartTarget* target,
                                                                           ProtonPlusModelsSteamSessionIdentity* original_identity,
                                                                           gboolean shutdown_sent,
                                                                           gboolean stopped,
                                                                           GCancellable* cancellable,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                                          GAsyncResult* _res_);
static gboolean proton_plus_services_steam_restart_orchestrator_same_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                        ProtonPlusModelsSteamSessionIdentity* first,
                                                                        ProtonPlusModelsSteamSessionIdentity* second);
static void proton_plus_services_steam_restart_orchestrator_dispatch_shutdown (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                        ProtonPlusModelsSteamRestartTarget* target,
                                                                        GCancellable* cancellable,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_);
static ProtonPlusServicesSteamRestartCommandResult* proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                                       GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_co (ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_);
static gboolean proton_plus_services_steam_restart_orchestrator_target_has_configuration_intent (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                          ProtonPlusModelsSteamRestartTarget* target);
static void proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_ready (GObject* source_object,
                                                                                    GAsyncResult* _res_,
                                                                                    gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_co (ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_);
static void proton_plus_services_steam_restart_orchestrator_launch_and_wait (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                      ProtonPlusModelsSteamRestartTarget* target,
                                                                      ProtonPlusModelsSteamSessionIdentity* original_identity,
                                                                      gboolean shutdown_sent,
                                                                      gboolean stopped,
                                                                      GObject* cancellation,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
static ProtonPlusModelsSteamRestartOperationResult* proton_plus_services_steam_restart_orchestrator_launch_and_wait_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                                     GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_ready (GObject* source_object,
                                                                                 GAsyncResult* _res_,
                                                                                 gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_launch_and_wait_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_launch_and_wait_co (ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_);
static void proton_plus_services_steam_restart_orchestrator_dispatch_launch (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                      ProtonPlusModelsSteamRestartTarget* target,
                                                                      GCancellable* cancellable,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
static ProtonPlusServicesSteamRestartCommandResult* proton_plus_services_steam_restart_orchestrator_dispatch_launch_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                                                     GAsyncResult* _res_);
static void proton_plus_services_steam_restart_orchestrator_launch_and_wait_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static gboolean proton_plus_services_steam_restart_orchestrator_is_new_confirmed_session (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                   ProtonPlusModelsSteamRestartTarget* target,
                                                                                   ProtonPlusModelsSteamSessionIdentity* original,
                                                                                   ProtonPlusServicesSteamSessionSnapshot* observed);
static void proton_plus_services_steam_restart_orchestrator_dispatch_launch_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_dispatch_launch_co (ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_);
static void proton_plus_services_steam_restart_orchestrator_dispatch_launch_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_co (ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_);
static void proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
static void proton_plus_services_steam_restart_orchestrator_set_last_snapshot (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                        ProtonPlusServicesSteamSessionSnapshot* value);
static void proton_plus_services_steam_restart_orchestrator_yield_main_context_data_free (gpointer _data);
static gboolean proton_plus_services_steam_restart_orchestrator_yield_main_context_co (ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData* _data_);
static Block66Data* block66_data_ref (Block66Data* _data66_);
static void block66_data_unref (void * _userdata_);
static gboolean __lambda346_ (Block66Data* _data66_);
static gboolean ___lambda346__gsource_func (gpointer self);
static void proton_plus_services_steam_restart_orchestrator_set_state (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                ProtonPlusModelsSteamRestartOperationState value);
static void proton_plus_services_steam_restart_orchestrator_finalize (GObject * obj);
static GType proton_plus_services_steam_restart_orchestrator_get_type_once (void);
static void _vala_proton_plus_services_steam_restart_orchestrator_get_property (GObject * object,
                                                                         guint property_id,
                                                                         GValue * value,
                                                                         GParamSpec * pspec);
static void _vala_proton_plus_services_steam_restart_orchestrator_set_property (GObject * object,
                                                                         guint property_id,
                                                                         const GValue * value,
                                                                         GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_services_steam_restart_orchestrator_get_instance_private (ProtonPlusServicesSteamRestartOrchestrator* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesSteamRestartOrchestrator_private_offset);
}

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

ProtonPlusServicesSteamRestartOrchestrator*
proton_plus_services_steam_restart_orchestrator_construct (GType object_type,
                                                           ProtonPlusServicesSteamSessionService* session_service,
                                                           ProtonPlusServicesSteamRestartManager* restart_manager,
                                                           ProtonPlusServicesSteamRestartBackend* backend,
                                                           guint poll_interval_msec,
                                                           guint exit_poll_limit,
                                                           guint start_poll_limit,
                                                           ProtonPlusServicesSteamConfigurationReconciler* configuration_reconciler)
{
	ProtonPlusServicesSteamRestartOrchestrator * self = NULL;
	ProtonPlusServicesSteamSessionService* _tmp0_;
	ProtonPlusServicesSteamRestartManager* _tmp1_;
	ProtonPlusServicesSteamRestartBackend* _tmp2_ = NULL;
	ProtonPlusServicesSteamRestartBackend* _tmp3_;
	ProtonPlusServicesSteamRestartBackend* _tmp5_;
	ProtonPlusServicesSteamConfigurationReconciler* _tmp6_;
	g_return_val_if_fail (session_service != NULL, NULL);
	g_return_val_if_fail (restart_manager != NULL, NULL);
	self = (ProtonPlusServicesSteamRestartOrchestrator*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (session_service);
	_g_object_unref0 (self->priv->session_service);
	self->priv->session_service = _tmp0_;
	_tmp1_ = _g_object_ref0 (restart_manager);
	_g_object_unref0 (self->priv->restart_manager);
	self->priv->restart_manager = _tmp1_;
	_tmp3_ = _g_object_ref0 (backend);
	_tmp2_ = _tmp3_;
	if (_tmp2_ == NULL) {
		ProtonPlusServicesHostSteamRestartBackend* _tmp4_;
		_tmp4_ = proton_plus_services_host_steam_restart_backend_new (NULL);
		_g_object_unref0 (_tmp2_);
		_tmp2_ = (ProtonPlusServicesSteamRestartBackend*) _tmp4_;
	}
	_tmp5_ = _tmp2_;
	_tmp2_ = NULL;
	_g_object_unref0 (self->priv->backend);
	self->priv->backend = _tmp5_;
	self->priv->poll_interval_msec = poll_interval_msec;
	self->priv->exit_poll_limit = exit_poll_limit;
	self->priv->start_poll_limit = start_poll_limit;
	_tmp6_ = _g_object_ref0 (configuration_reconciler);
	_g_object_unref0 (self->priv->configuration_reconciler);
	self->priv->configuration_reconciler = _tmp6_;
	_g_object_unref0 (_tmp2_);
	return self;
}

ProtonPlusServicesSteamRestartOrchestrator*
proton_plus_services_steam_restart_orchestrator_new (ProtonPlusServicesSteamSessionService* session_service,
                                                     ProtonPlusServicesSteamRestartManager* restart_manager,
                                                     ProtonPlusServicesSteamRestartBackend* backend,
                                                     guint poll_interval_msec,
                                                     guint exit_poll_limit,
                                                     guint start_poll_limit,
                                                     ProtonPlusServicesSteamConfigurationReconciler* configuration_reconciler)
{
	return proton_plus_services_steam_restart_orchestrator_construct (PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, session_service, restart_manager, backend, poll_interval_msec, exit_poll_limit, start_poll_limit, configuration_reconciler);
}

static void
proton_plus_services_steam_restart_orchestrator_restart_target_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->cancellation);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorRestartTargetData, _data_);
}

void
proton_plus_services_steam_restart_orchestrator_restart_target (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                ProtonPlusModelsSteamRestartTarget* target,
                                                                GObject* cancellation,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	GObject* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorRestartTargetData);
	_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_restart_orchestrator_restart_target_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellation);
	_g_object_unref0 (_data_->cancellation);
	_data_->cancellation = _tmp2_;
	proton_plus_services_steam_restart_orchestrator_restart_target_co (_data_);
}

ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_restart_target_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                       GAsyncResult* _res_)
{
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_restart_target_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_restart_target_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_restart_target_co (ProtonPlusServicesSteamRestartOrchestratorRestartTargetData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->operation_active) {
		_data_->_tmp0_ = _data_->self->priv->_last_snapshot;
		_data_->_tmp1_ = proton_plus_services_steam_restart_orchestrator_result (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_FAILED, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_ALREADY_IN_PROGRESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, _data_->_tmp0_, "Another Steam restart transaction is still active.");
		_data_->result = _data_->_tmp1_;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->self->priv->operation_active = TRUE;
	{
		_data_->_state_ = 1;
		proton_plus_services_steam_restart_orchestrator_yield_main_context (_data_->self, proton_plus_services_steam_restart_orchestrator_restart_target_ready, _data_);
		return FALSE;
		_state_1:
		proton_plus_services_steam_restart_orchestrator_yield_main_context_finish (_data_->self, _data_->_res_);
		_data_->_state_ = 2;
		proton_plus_services_steam_restart_orchestrator_run (_data_->self, _data_->target, _data_->cancellation, proton_plus_services_steam_restart_orchestrator_restart_target_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp2_ = proton_plus_services_steam_restart_orchestrator_run_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->completed);
		_data_->completed = _data_->_tmp2_;
	}
	__finally0:
	{
		_data_->self->priv->operation_active = FALSE;
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->completed);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->completed;
	g_signal_emit (_data_->self, proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_OPERATION_COMPLETED_SIGNAL], 0, _data_->_tmp3_);
	_data_->result = _data_->completed;
	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_restart_orchestrator_run_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->cancellation);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorRunData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_run (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                     ProtonPlusModelsSteamRestartTarget* target,
                                                     GObject* cancellation,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRunData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	GObject* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorRunData);
	_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_restart_orchestrator_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellation);
	_g_object_unref0 (_data_->cancellation);
	_data_->cancellation = _tmp2_;
	proton_plus_services_steam_restart_orchestrator_run_co (_data_);
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_run_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                            GAsyncResult* _res_)
{
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamRestartOrchestratorRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_run_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_run_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_run_co (ProtonPlusServicesSteamRestartOrchestratorRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->cancellation, g_cancellable_get_type ()) ? ((GCancellable*) _data_->cancellation) : NULL);
	_data_->cancellable = _data_->_tmp0_;
	_data_->shutdown_sent = FALSE;
	_data_->stopped = FALSE;
	_data_->launch_sent = FALSE;
	_data_->started = FALSE;
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_PREFLIGHT);
	_data_->_tmp1_ = _data_->cancellable;
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp1_)) {
		_data_->_tmp2_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Cancelled before preflight.");
		_data_->result = _data_->_tmp2_;
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->self->priv->restart_manager;
	if (proton_plus_services_steam_restart_manager_pending_count_for_target (_data_->_tmp3_, _data_->target) == 0) {
		_data_->_tmp4_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NO_PENDING_CHANGES, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "No pending restart receipts exist for this physical target.");
		_data_->result = _data_->_tmp4_;
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = proton_plus_services_steam_restart_orchestrator_observe (_data_->self, _data_->target, TRUE);
	_data_->preflight = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->preflight;
	_data_->_tmp7_ = proton_plus_services_steam_session_snapshot_get_session_mode (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->steamos_handoff = _data_->_tmp8_ == PROTON_PLUS_SERVICES_STEAM_SESSION_MODE_STEAMOS_GAMING_MODE;
	_data_->_tmp9_ = _data_->preflight;
	_data_->preflight_reason = proton_plus_services_steam_restart_orchestrator_reject_preflight (_data_->self, _data_->target, _data_->_tmp9_, _data_->steamos_handoff);
	if (_data_->preflight_reason != PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE) {
		_data_->_tmp10_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, _data_->preflight_reason, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Restart preflight rejected the current Steam observation.");
		_data_->result = _data_->_tmp10_;
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		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;
	}
	if (_data_->steamos_handoff) {
		_data_->_tmp11_ = _data_->preflight;
		_data_->_tmp12_ = _data_->cancellable;
		_data_->_state_ = 1;
		proton_plus_services_steam_restart_orchestrator_request_steamos_handoff (_data_->self, _data_->target, _data_->_tmp11_, _data_->_tmp12_, proton_plus_services_steam_restart_orchestrator_run_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp13_ = proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_finish (_data_->self, _data_->_res_);
		_data_->result = _data_->_tmp13_;
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->preflight;
	_data_->_tmp16_ = proton_plus_services_steam_restart_orchestrator_identity (_data_->self, _data_->target, _data_->_tmp15_);
	_data_->_tmp14_ = _data_->_tmp16_;
	if (_data_->_tmp14_ == NULL) {
		_data_->_tmp17_ = proton_plus_services_steam_restart_orchestrator_pending_identity (_data_->self, _data_->target);
		_g_object_unref0 (_data_->_tmp14_);
		_data_->_tmp14_ = _data_->_tmp17_;
	}
	_data_->_tmp18_ = _data_->_tmp14_;
	_data_->_tmp14_ = NULL;
	_data_->original_identity = _data_->_tmp18_;
	if (!proton_plus_services_steam_restart_orchestrator_has_relaunch_strategy (_data_->self, _data_->target)) {
		_data_->_tmp19_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_RELAUNCH_UNAVAILABLE, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "No validated target-specific relaunch strategy is currently available.");
		_data_->result = _data_->_tmp19_;
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp20_ = _data_->preflight;
	if (proton_plus_services_steam_restart_orchestrator_is_confirmed_stopped (_data_->self, _data_->_tmp20_)) {
		_data_->stopped = TRUE;
		_data_->_tmp21_ = _data_->original_identity;
		_data_->_tmp22_ = _data_->cancellable;
		_data_->_state_ = 2;
		proton_plus_services_steam_restart_orchestrator_reconcile_and_launch (_data_->self, _data_->target, _data_->_tmp21_, _data_->shutdown_sent, _data_->stopped, _data_->_tmp22_, proton_plus_services_steam_restart_orchestrator_run_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp23_ = proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_finish (_data_->self, _data_->_res_);
		_data_->result = _data_->_tmp23_;
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp24_ = proton_plus_services_steam_restart_orchestrator_observe (_data_->self, _data_->target, TRUE);
	_data_->dispatch_snapshot = _data_->_tmp24_;
	_data_->_tmp25_ = _data_->dispatch_snapshot;
	_data_->dispatch_reason = proton_plus_services_steam_restart_orchestrator_reject_preflight (_data_->self, _data_->target, _data_->_tmp25_, FALSE);
	if (_data_->dispatch_reason != PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE) {
		_data_->_tmp26_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, _data_->dispatch_reason, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Steam observation changed before shutdown dispatch.");
		_data_->result = _data_->_tmp26_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp27_ = _data_->original_identity;
	_data_->_tmp28_ = _data_->dispatch_snapshot;
	_data_->_tmp29_ = proton_plus_services_steam_restart_orchestrator_identity (_data_->self, _data_->target, _data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp31_ = !proton_plus_services_steam_restart_orchestrator_same_identity (_data_->self, _data_->_tmp27_, _data_->_tmp30_);
	_g_object_unref0 (_data_->_tmp30_);
	if (_data_->_tmp31_) {
		_data_->_tmp32_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_TARGET_SNAPSHOT_MISMATCH, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Steam generation changed between preflight and shutdown dispatch.");
		_data_->result = _data_->_tmp32_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp33_ = _data_->cancellable;
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp33_)) {
		_data_->_tmp34_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Cancelled before shutdown dispatch.");
		_data_->result = _data_->_tmp34_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_REQUESTING_SHUTDOWN);
	_data_->_tmp35_ = _data_->cancellable;
	_data_->_state_ = 3;
	proton_plus_services_steam_restart_orchestrator_dispatch_shutdown (_data_->self, _data_->target, _data_->_tmp35_, proton_plus_services_steam_restart_orchestrator_run_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp36_ = proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_finish (_data_->self, _data_->_res_);
	_data_->shutdown = _data_->_tmp36_;
	_data_->_tmp37_ = _data_->shutdown;
	if (_data_->_tmp37_ == NULL) {
		_data_->_tmp38_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Shutdown dispatch was cancelled before a command result was available.");
		_data_->result = _data_->_tmp38_;
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp39_ = _data_->shutdown;
	_data_->_tmp40_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp39_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_COMMAND_RESULT, ProtonPlusServicesSteamRestartCommandResult));
	_data_->shutdown_result = _data_->_tmp40_;
	_data_->_tmp42_ = _data_->shutdown_result;
	_data_->_tmp43_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp42_);
	_data_->_tmp44_ = _data_->_tmp43_;
	if (_data_->_tmp44_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp41_ = TRUE;
	} else {
		_data_->_tmp45_ = _data_->shutdown_result;
		_data_->_tmp46_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp45_);
		_data_->_tmp47_ = _data_->_tmp46_;
		_data_->_tmp41_ = _data_->_tmp47_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED;
	}
	_data_->shutdown_sent = _data_->_tmp41_;
	_data_->_tmp49_ = _data_->shutdown_result;
	_data_->_tmp50_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp49_);
	_data_->_tmp51_ = _data_->_tmp50_;
	if (_data_->_tmp51_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED) {
		_data_->_tmp48_ = TRUE;
	} else {
		_data_->_tmp52_ = _data_->cancellable;
		_data_->_tmp48_ = proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp52_);
	}
	if (_data_->_tmp48_) {
		_data_->_tmp53_ = _data_->shutdown_result;
		_data_->_tmp54_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp53_);
		_data_->_tmp55_ = _data_->_tmp54_;
		_data_->_tmp56_ = g_strconcat ("Shutdown may continue independently after cancellation: ", _data_->_tmp55_, NULL);
		_data_->_tmp57_ = _data_->_tmp56_;
		_data_->_tmp58_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp57_);
		_data_->_tmp59_ = _data_->_tmp58_;
		_g_free0 (_data_->_tmp57_);
		_data_->result = _data_->_tmp59_;
		_g_object_unref0 (_data_->shutdown_result);
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp60_ = _data_->shutdown_result;
	_data_->_tmp61_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp60_);
	_data_->_tmp62_ = _data_->_tmp61_;
	if (_data_->_tmp62_ != PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp63_ = _data_->shutdown_result;
		_data_->_tmp64_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp63_);
		_data_->_tmp65_ = _data_->_tmp64_;
		_data_->_tmp66_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_GRACEFUL_SHUTDOWN_FAILED, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp65_);
		_data_->result = _data_->_tmp66_;
		_g_object_unref0 (_data_->shutdown_result);
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		_g_object_unref0 (_data_->_tmp14_);
		_g_object_unref0 (_data_->preflight);
		_g_object_unref0 (_data_->cancellable);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_WAITING_FOR_EXIT);
	{
		_data_->poll = (guint) 0;
		{
			_data_->_tmp67_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp67_) {
					_data_->_tmp68_ = _data_->poll;
					_data_->poll = _data_->_tmp68_ + 1;
				}
				_data_->_tmp67_ = FALSE;
				if (!(_data_->poll < _data_->self->priv->exit_poll_limit)) {
					break;
				}
				_data_->_tmp69_ = _data_->cancellable;
				if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp69_)) {
					_data_->_tmp70_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Shutdown was dispatched; no automatic relaunch follows cancellation.");
					_data_->result = _data_->_tmp70_;
					_g_object_unref0 (_data_->shutdown_result);
					_g_object_unref0 (_data_->shutdown);
					_g_object_unref0 (_data_->dispatch_snapshot);
					_g_object_unref0 (_data_->original_identity);
					_g_object_unref0 (_data_->_tmp14_);
					_g_object_unref0 (_data_->preflight);
					_g_object_unref0 (_data_->cancellable);
					g_task_return_pointer (_data_->_async_result, _data_, NULL);
					if (_data_->_state_ != 0) {
						while (!g_task_get_completed (_data_->_async_result)) {
							g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
						}
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp71_ = proton_plus_services_steam_restart_orchestrator_observe (_data_->self, _data_->target, TRUE);
				_data_->observed = _data_->_tmp71_;
				_data_->_tmp72_ = _data_->observed;
				if (proton_plus_services_steam_restart_orchestrator_is_confirmed_stopped (_data_->self, _data_->_tmp72_)) {
					_data_->stopped = TRUE;
					_data_->_tmp73_ = _data_->original_identity;
					_data_->_tmp74_ = _data_->cancellable;
					_data_->_state_ = 4;
					proton_plus_services_steam_restart_orchestrator_reconcile_and_launch (_data_->self, _data_->target, _data_->_tmp73_, _data_->shutdown_sent, _data_->stopped, _data_->_tmp74_, proton_plus_services_steam_restart_orchestrator_run_ready, _data_);
					return FALSE;
					_state_4:
					_data_->_tmp75_ = proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_finish (_data_->self, _data_->_res_);
					_data_->result = _data_->_tmp75_;
					_g_object_unref0 (_data_->observed);
					_g_object_unref0 (_data_->shutdown_result);
					_g_object_unref0 (_data_->shutdown);
					_g_object_unref0 (_data_->dispatch_snapshot);
					_g_object_unref0 (_data_->original_identity);
					_g_object_unref0 (_data_->_tmp14_);
					_g_object_unref0 (_data_->preflight);
					_g_object_unref0 (_data_->cancellable);
					g_task_return_pointer (_data_->_async_result, _data_, NULL);
					if (_data_->_state_ != 0) {
						while (!g_task_get_completed (_data_->_async_result)) {
							g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
						}
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp78_ = _data_->observed;
				_data_->_tmp79_ = proton_plus_services_steam_session_snapshot_get_state (_data_->_tmp78_);
				_data_->_tmp80_ = _data_->_tmp79_;
				if (_data_->_tmp80_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_UNKNOWN) {
					_data_->_tmp77_ = TRUE;
				} else {
					_data_->_tmp81_ = _data_->observed;
					_data_->_tmp82_ = proton_plus_services_steam_session_snapshot_get_state (_data_->_tmp81_);
					_data_->_tmp83_ = _data_->_tmp82_;
					_data_->_tmp77_ = _data_->_tmp83_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STARTING;
				}
				if (_data_->_tmp77_) {
					_data_->_tmp76_ = TRUE;
				} else {
					_data_->_tmp84_ = _data_->observed;
					_data_->_tmp85_ = proton_plus_services_steam_session_snapshot_get_state (_data_->_tmp84_);
					_data_->_tmp86_ = _data_->_tmp85_;
					_data_->_tmp76_ = _data_->_tmp86_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_UPDATING;
				}
				if (_data_->_tmp76_) {
					_data_->_tmp87_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STATE_UNKNOWN_OR_AMBIGUOUS, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Unsafe Steam state while waiting for shutdown.");
					_data_->result = _data_->_tmp87_;
					_g_object_unref0 (_data_->observed);
					_g_object_unref0 (_data_->shutdown_result);
					_g_object_unref0 (_data_->shutdown);
					_g_object_unref0 (_data_->dispatch_snapshot);
					_g_object_unref0 (_data_->original_identity);
					_g_object_unref0 (_data_->_tmp14_);
					_g_object_unref0 (_data_->preflight);
					_g_object_unref0 (_data_->cancellable);
					g_task_return_pointer (_data_->_async_result, _data_, NULL);
					if (_data_->_state_ != 0) {
						while (!g_task_get_completed (_data_->_async_result)) {
							g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
						}
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp88_ = _data_->self->priv->backend;
				_data_->_tmp89_ = _data_->cancellable;
				_data_->_state_ = 5;
				proton_plus_services_steam_restart_backend_delay (_data_->_tmp88_, _data_->self->priv->poll_interval_msec, _data_->_tmp89_, proton_plus_services_steam_restart_orchestrator_run_ready, _data_);
				return FALSE;
				_state_5:
				if (!proton_plus_services_steam_restart_backend_delay_finish (_data_->_tmp88_, _data_->_res_)) {
					_data_->_tmp90_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Shutdown was dispatched; polling was cancelled.");
					_data_->result = _data_->_tmp90_;
					_g_object_unref0 (_data_->observed);
					_g_object_unref0 (_data_->shutdown_result);
					_g_object_unref0 (_data_->shutdown);
					_g_object_unref0 (_data_->dispatch_snapshot);
					_g_object_unref0 (_data_->original_identity);
					_g_object_unref0 (_data_->_tmp14_);
					_g_object_unref0 (_data_->preflight);
					_g_object_unref0 (_data_->cancellable);
					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;
				}
				_g_object_unref0 (_data_->observed);
			}
		}
	}
	_data_->_tmp91_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_EXIT_TIMEOUT, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Timed out waiting for confirmed Steam exit; no force termination was a" \
"ttempted.");
	_data_->result = _data_->_tmp91_;
	_g_object_unref0 (_data_->shutdown_result);
	_g_object_unref0 (_data_->shutdown);
	_g_object_unref0 (_data_->dispatch_snapshot);
	_g_object_unref0 (_data_->original_identity);
	_g_object_unref0 (_data_->_tmp14_);
	_g_object_unref0 (_data_->preflight);
	_g_object_unref0 (_data_->cancellable);
	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_restart_orchestrator_request_steamos_handoff_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->preflight);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_request_steamos_handoff (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                         ProtonPlusModelsSteamRestartTarget* target,
                                                                         ProtonPlusServicesSteamSessionSnapshot* preflight,
                                                                         GCancellable* cancellable,
                                                                         GAsyncReadyCallback _callback_,
                                                                         gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	g_return_if_fail (preflight != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (preflight);
	_g_object_unref0 (_data_->preflight);
	_data_->preflight = _tmp2_;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_co (_data_);
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                GAsyncResult* _res_)
{
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_ready (GObject* source_object,
                                                                               GAsyncResult* _res_,
                                                                               gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_co (ProtonPlusServicesSteamRestartOrchestratorRequestSteamosHandoffData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_models_steam_restart_target_get_installation_kind (_data_->target);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ != PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_NATIVE) {
		_data_->_tmp2_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAMOS_GAMING_MODE, FALSE, FALSE, FALSE, FALSE, "SteamOS Gaming Mode handoff supports only the native Steam installatio" \
"n.");
		_data_->result = _data_->_tmp2_;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = proton_plus_services_steam_restart_orchestrator_identity (_data_->self, _data_->target, _data_->preflight);
	_data_->original_identity = _data_->_tmp3_;
	_data_->_tmp5_ = proton_plus_services_steam_session_snapshot_get_state (_data_->preflight);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_RUNNING) {
		_data_->_tmp4_ = TRUE;
	} else {
		_data_->_tmp7_ = _data_->original_identity;
		_data_->_tmp4_ = _data_->_tmp7_ == NULL;
	}
	if (_data_->_tmp4_) {
		_data_->_tmp8_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAMOS_GAMING_MODE, FALSE, FALSE, FALSE, FALSE, "SteamOS Gaming Mode handoff requires a confirmed running native Steam " \
"process with a stable identity.");
		_data_->result = _data_->_tmp8_;
		_g_object_unref0 (_data_->original_identity);
		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;
	}
	if (proton_plus_services_steam_restart_orchestrator_target_has_configuration_intent (_data_->self, _data_->target)) {
		_data_->_tmp9_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAMOS_CONFIGURATION_REQUIRES_DESKTOP_MODE, FALSE, FALSE, FALSE, FALSE, "Staged Steam-owned configuration must be reconciled while Steam is sto" \
"pped; Gaming Mode may terminate ProtonPlus before that step.");
		_data_->result = _data_->_tmp9_;
		_g_object_unref0 (_data_->original_identity);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = proton_plus_services_steam_restart_orchestrator_observe (_data_->self, _data_->target, FALSE);
	_data_->dispatch_snapshot = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->dispatch_snapshot;
	_data_->_tmp12_ = proton_plus_services_steam_session_snapshot_get_session_mode (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	if (_data_->_tmp13_ != PROTON_PLUS_SERVICES_STEAM_SESSION_MODE_STEAMOS_GAMING_MODE) {
		_data_->_tmp14_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_TARGET_SNAPSHOT_MISMATCH, FALSE, FALSE, FALSE, FALSE, "Steam session mode changed before the Gaming Mode shutdown handoff.");
		_data_->result = _data_->_tmp14_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->dispatch_snapshot;
	_data_->dispatch_reason = proton_plus_services_steam_restart_orchestrator_reject_preflight (_data_->self, _data_->target, _data_->_tmp15_, TRUE);
	if (_data_->dispatch_reason != PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE) {
		_data_->_tmp16_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, _data_->dispatch_reason, FALSE, FALSE, FALSE, FALSE, "Steam observation changed before the Gaming Mode shutdown handoff.");
		_data_->result = _data_->_tmp16_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->original_identity;
	_data_->_tmp18_ = _data_->dispatch_snapshot;
	_data_->_tmp19_ = proton_plus_services_steam_restart_orchestrator_identity (_data_->self, _data_->target, _data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp21_ = !proton_plus_services_steam_restart_orchestrator_same_identity (_data_->self, _data_->_tmp17_, _data_->_tmp20_);
	_g_object_unref0 (_data_->_tmp20_);
	if (_data_->_tmp21_) {
		_data_->_tmp22_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_TARGET_SNAPSHOT_MISMATCH, FALSE, FALSE, FALSE, FALSE, "Steam generation changed before the Gaming Mode shutdown handoff.");
		_data_->result = _data_->_tmp22_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		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;
	}
	if (proton_plus_services_steam_restart_orchestrator_target_has_configuration_intent (_data_->self, _data_->target)) {
		_data_->_tmp23_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAMOS_CONFIGURATION_REQUIRES_DESKTOP_MODE, FALSE, FALSE, FALSE, FALSE, "A staged Steam-owned configuration change appeared before shutdown dis" \
"patch.");
		_data_->result = _data_->_tmp23_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		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;
	}
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->cancellable)) {
		_data_->_tmp24_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, FALSE, FALSE, FALSE, FALSE, "Cancelled before the Gaming Mode shutdown handoff.");
		_data_->result = _data_->_tmp24_;
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_REQUESTING_SHUTDOWN);
	_data_->_tmp25_ = _data_->self->priv->backend;
	_data_->_state_ = 1;
	proton_plus_services_steam_restart_backend_request_native_shutdown (_data_->_tmp25_, proton_plus_globals_IS_FLATPAK, _data_->cancellable, proton_plus_services_steam_restart_orchestrator_request_steamos_handoff_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp26_ = proton_plus_services_steam_restart_backend_request_native_shutdown_finish (_data_->_tmp25_, _data_->_res_);
	_data_->shutdown = _data_->_tmp26_;
	_data_->_tmp27_ = _data_->shutdown;
	if (_data_->_tmp27_ == NULL) {
		_data_->_tmp28_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, FALSE, FALSE, FALSE, FALSE, "Gaming Mode shutdown dispatch was cancelled before a command result wa" \
"s available.");
		_data_->result = _data_->_tmp28_;
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->shutdown;
	_data_->_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp29_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_COMMAND_RESULT, ProtonPlusServicesSteamRestartCommandResult));
	_data_->shutdown_result = _data_->_tmp30_;
	_data_->_tmp32_ = _data_->shutdown_result;
	_data_->_tmp33_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp32_);
	_data_->_tmp34_ = _data_->_tmp33_;
	if (_data_->_tmp34_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp31_ = TRUE;
	} else {
		_data_->_tmp35_ = _data_->shutdown_result;
		_data_->_tmp36_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp31_ = _data_->_tmp37_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED;
	}
	_data_->shutdown_sent = _data_->_tmp31_;
	_data_->_tmp38_ = _data_->shutdown_result;
	_data_->_tmp39_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	if (_data_->_tmp40_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED) {
		_data_->_tmp41_ = _data_->shutdown_result;
		_data_->_tmp42_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp41_);
		_data_->_tmp43_ = _data_->_tmp42_;
		_data_->_tmp44_ = g_strconcat ("Gaming Mode shutdown may continue independently after cancellation: ", _data_->_tmp43_, NULL);
		_data_->_tmp45_ = _data_->_tmp44_;
		_data_->_tmp46_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, FALSE, FALSE, FALSE, _data_->_tmp45_);
		_data_->_tmp47_ = _data_->_tmp46_;
		_g_free0 (_data_->_tmp45_);
		_data_->result = _data_->_tmp47_;
		_g_object_unref0 (_data_->shutdown_result);
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp48_ = _data_->shutdown_result;
	_data_->_tmp49_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp48_);
	_data_->_tmp50_ = _data_->_tmp49_;
	if (_data_->_tmp50_ != PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp51_ = _data_->shutdown_result;
		_data_->_tmp52_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp51_);
		_data_->_tmp53_ = _data_->_tmp52_;
		_data_->_tmp54_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_GRACEFUL_SHUTDOWN_FAILED, _data_->shutdown_sent, FALSE, FALSE, FALSE, _data_->_tmp53_);
		_data_->result = _data_->_tmp54_;
		_g_object_unref0 (_data_->shutdown_result);
		_g_object_unref0 (_data_->shutdown);
		_g_object_unref0 (_data_->dispatch_snapshot);
		_g_object_unref0 (_data_->original_identity);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_STEAMOS_HANDOFF_REQUESTED);
	_data_->_tmp55_ = _data_->dispatch_snapshot;
	_data_->_tmp56_ = proton_plus_services_steam_restart_orchestrator_result (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_STEAMOS_HANDOFF_REQUESTED, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, _data_->_tmp55_, "Native Steam accepted the graceful shutdown request; restart completio" \
"n was handed off to SteamOS.");
	_data_->result = _data_->_tmp56_;
	_g_object_unref0 (_data_->shutdown_result);
	_g_object_unref0 (_data_->shutdown);
	_g_object_unref0 (_data_->dispatch_snapshot);
	_g_object_unref0 (_data_->original_identity);
	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_restart_orchestrator_reconcile_and_launch_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->original_identity);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_reconcile_and_launch (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                      ProtonPlusModelsSteamRestartTarget* target,
                                                                      ProtonPlusModelsSteamSessionIdentity* original_identity,
                                                                      gboolean shutdown_sent,
                                                                      gboolean stopped,
                                                                      GCancellable* cancellable,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	ProtonPlusModelsSteamSessionIdentity* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (original_identity);
	_g_object_unref0 (_data_->original_identity);
	_data_->original_identity = _tmp2_;
	_data_->shutdown_sent = shutdown_sent;
	_data_->stopped = stopped;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_co (_data_);
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                             GAsyncResult* _res_)
{
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_co (ProtonPlusServicesSteamRestartOrchestratorReconcileAndLaunchData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->cancellable)) {
		_data_->_tmp0_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, FALSE, FALSE, "Cancelled after Steam stopped; pending changes were retained.");
		_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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_APPLYING_CHANGES);
	_data_->_tmp2_ = _data_->self->priv->configuration_reconciler;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp1_ = proton_plus_services_steam_restart_orchestrator_target_has_configuration_intent (_data_->self, _data_->target);
	} else {
		_data_->_tmp1_ = FALSE;
	}
	if (_data_->_tmp1_) {
		_data_->_tmp3_ = _data_->self->priv->configuration_reconciler;
		_data_->_tmp4_ = proton_plus_services_steam_configuration_reconciler_reconcile_target (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_RECONCILER, ProtonPlusServicesSteamConfigurationReconciler), _data_->target);
		_data_->outcome = _data_->_tmp4_;
		_data_->_tmp7_ = _data_->outcome;
		_data_->_tmp8_ = proton_plus_services_steam_configuration_mutation_get_result (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		if (_data_->_tmp9_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_FAILED) {
			_data_->_tmp6_ = TRUE;
		} else {
			_data_->_tmp10_ = _data_->outcome;
			_data_->_tmp11_ = proton_plus_services_steam_configuration_mutation_get_result (_data_->_tmp10_);
			_data_->_tmp12_ = _data_->_tmp11_;
			_data_->_tmp6_ = _data_->_tmp12_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_CONFLICT;
		}
		if (_data_->_tmp6_) {
			_data_->_tmp5_ = TRUE;
		} else {
			_data_->_tmp13_ = _data_->outcome;
			_data_->_tmp14_ = proton_plus_services_steam_configuration_mutation_get_result (_data_->_tmp13_);
			_data_->_tmp15_ = _data_->_tmp14_;
			_data_->_tmp5_ = _data_->_tmp15_ == PROTON_PLUS_SERVICES_STEAM_CONFIGURATION_MUTATION_RESULT_PERSISTENCE_FAILED;
		}
		if (_data_->_tmp5_) {
			_data_->_tmp17_ = _data_->outcome;
			_data_->_tmp18_ = proton_plus_services_steam_configuration_mutation_get_error (_data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_data_->_tmp16_ = _data_->_tmp19_;
			if (_data_->_tmp16_ == NULL) {
				_data_->_tmp16_ = "Pending configuration could not be reconciled.";
			}
			_data_->_tmp20_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_CONFIGURATION_RECONCILIATION_FAILED, _data_->shutdown_sent, _data_->stopped, FALSE, FALSE, _data_->_tmp16_);
			_data_->result = _data_->_tmp20_;
			_g_object_unref0 (_data_->outcome);
			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;
		}
		_g_object_unref0 (_data_->outcome);
	}
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->cancellable)) {
		_data_->_tmp21_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, FALSE, FALSE, "Cancelled after applying changes; no relaunch was requested.");
		_data_->result = _data_->_tmp21_;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	proton_plus_services_steam_restart_orchestrator_launch_and_wait (_data_->self, _data_->target, _data_->original_identity, _data_->shutdown_sent, _data_->stopped, (GObject*) _data_->cancellable, proton_plus_services_steam_restart_orchestrator_reconcile_and_launch_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp22_ = proton_plus_services_steam_restart_orchestrator_launch_and_wait_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp22_;
	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_restart_orchestrator_launch_and_wait_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->original_identity);
	_g_object_unref0 (_data_->cancellation);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_launch_and_wait (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                 ProtonPlusModelsSteamRestartTarget* target,
                                                                 ProtonPlusModelsSteamSessionIdentity* original_identity,
                                                                 gboolean shutdown_sent,
                                                                 gboolean stopped,
                                                                 GObject* cancellation,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	ProtonPlusModelsSteamSessionIdentity* _tmp2_;
	GObject* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData);
	_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_restart_orchestrator_launch_and_wait_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (original_identity);
	_g_object_unref0 (_data_->original_identity);
	_data_->original_identity = _tmp2_;
	_data_->shutdown_sent = shutdown_sent;
	_data_->stopped = stopped;
	_tmp3_ = _g_object_ref0 (cancellation);
	_g_object_unref0 (_data_->cancellation);
	_data_->cancellation = _tmp3_;
	proton_plus_services_steam_restart_orchestrator_launch_and_wait_co (_data_);
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_launch_and_wait_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                        GAsyncResult* _res_)
{
	ProtonPlusModelsSteamRestartOperationResult* result;
	ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_launch_and_wait_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_launch_and_wait_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_launch_and_wait_co (ProtonPlusServicesSteamRestartOrchestratorLaunchAndWaitData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->cancellation, g_cancellable_get_type ()) ? ((GCancellable*) _data_->cancellation) : NULL);
	_data_->cancellable = _data_->_tmp0_;
	_data_->launch_sent = FALSE;
	_data_->started = FALSE;
	_data_->_tmp1_ = _data_->cancellable;
	if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp1_)) {
		_data_->_tmp2_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Cancelled before launch dispatch.");
		_data_->result = _data_->_tmp2_;
		_g_object_unref0 (_data_->cancellable);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_LAUNCHING);
	_data_->_tmp3_ = _data_->cancellable;
	_data_->_state_ = 1;
	proton_plus_services_steam_restart_orchestrator_dispatch_launch (_data_->self, _data_->target, _data_->_tmp3_, proton_plus_services_steam_restart_orchestrator_launch_and_wait_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = proton_plus_services_steam_restart_orchestrator_dispatch_launch_finish (_data_->self, _data_->_res_);
	_data_->launch = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->launch;
	if (_data_->_tmp5_ == NULL) {
		_data_->_tmp6_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Launch dispatch was cancelled before a command result was available.");
		_data_->result = _data_->_tmp6_;
		_g_object_unref0 (_data_->launch);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->launch;
	_data_->_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp7_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_COMMAND_RESULT, ProtonPlusServicesSteamRestartCommandResult));
	_data_->launch_result = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->launch_result;
	_data_->_tmp11_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	if (_data_->_tmp12_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp9_ = TRUE;
	} else {
		_data_->_tmp13_ = _data_->launch_result;
		_data_->_tmp14_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp9_ = _data_->_tmp15_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED;
	}
	_data_->launch_sent = _data_->_tmp9_;
	_data_->_tmp17_ = _data_->launch_result;
	_data_->_tmp18_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	if (_data_->_tmp19_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED) {
		_data_->_tmp16_ = TRUE;
	} else {
		_data_->_tmp20_ = _data_->cancellable;
		_data_->_tmp16_ = proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp20_);
	}
	if (_data_->_tmp16_) {
		_data_->_tmp21_ = _data_->launch_result;
		_data_->_tmp22_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = g_strconcat ("Launch may have been requested before cancellation: ", _data_->_tmp23_, NULL);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_g_free0 (_data_->_tmp25_);
		_data_->result = _data_->_tmp27_;
		_g_object_unref0 (_data_->launch_result);
		_g_object_unref0 (_data_->launch);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp28_ = _data_->launch_result;
	_data_->_tmp29_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	if (_data_->_tmp30_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_UNAVAILABLE) {
		_data_->_tmp31_ = _data_->launch_result;
		_data_->_tmp32_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_tmp34_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_RELAUNCH_UNAVAILABLE, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp33_);
		_data_->result = _data_->_tmp34_;
		_g_object_unref0 (_data_->launch_result);
		_g_object_unref0 (_data_->launch);
		_g_object_unref0 (_data_->cancellable);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp35_ = _data_->launch_result;
	_data_->_tmp36_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	if (_data_->_tmp37_ != PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
		_data_->_tmp38_ = _data_->launch_result;
		_data_->_tmp39_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp38_);
		_data_->_tmp40_ = _data_->_tmp39_;
		_data_->_tmp41_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_RELAUNCH_FAILED, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp40_);
		_data_->result = _data_->_tmp41_;
		_g_object_unref0 (_data_->launch_result);
		_g_object_unref0 (_data_->launch);
		_g_object_unref0 (_data_->cancellable);
		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;
	}
	proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_WAITING_FOR_START);
	_data_->update_observed = FALSE;
	_data_->update_relaunch_sent = FALSE;
	_data_->poll = (guint) 0;
	while (TRUE) {
		if (!(_data_->poll < _data_->self->priv->start_poll_limit)) {
			break;
		}
		_data_->_tmp42_ = _data_->cancellable;
		if (proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp42_)) {
			_data_->_tmp43_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Launch was dispatched; no additional control action follows cancellati" \
"on.");
			_data_->result = _data_->_tmp43_;
			_g_object_unref0 (_data_->launch_result);
			_g_object_unref0 (_data_->launch);
			_g_object_unref0 (_data_->cancellable);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp44_ = proton_plus_services_steam_restart_orchestrator_observe (_data_->self, _data_->target, TRUE);
		_data_->observed = _data_->_tmp44_;
		_data_->_tmp45_ = _data_->observed;
		_data_->_tmp46_ = proton_plus_services_steam_session_snapshot_get_state (_data_->_tmp45_);
		_data_->_tmp47_ = _data_->_tmp46_;
		if (_data_->_tmp47_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_UPDATING) {
			_data_->update_observed = TRUE;
		}
		_data_->_tmp48_ = _data_->observed;
		if (proton_plus_services_steam_restart_orchestrator_is_new_confirmed_session (_data_->self, _data_->target, _data_->original_identity, _data_->_tmp48_)) {
			_data_->started = TRUE;
			_data_->_tmp49_ = _data_->self->priv->configuration_reconciler;
			if (_data_->_tmp49_ != NULL) {
				_data_->_tmp50_ = _data_->self->priv->configuration_reconciler;
				proton_plus_services_steam_configuration_reconciler_verify_target_after_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp50_, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_RECONCILER, ProtonPlusServicesSteamConfigurationReconciler), _data_->target);
			}
			_data_->_tmp51_ = _data_->self->priv->restart_manager;
			_data_->cleared = proton_plus_services_steam_restart_manager_pending_count_for_target (_data_->_tmp51_, _data_->target) == 0;
			_data_->_tmp52_ = _data_->self->priv->restart_manager;
			_data_->_tmp53_ = proton_plus_services_steam_restart_manager_get_last_persistence_error (_data_->_tmp52_);
			_data_->_tmp54_ = _data_->_tmp53_;
			_data_->persistence_failed = _data_->_tmp54_ != NULL;
			if (!_data_->cleared) {
				if (_data_->persistence_failed) {
					_data_->_tmp55_ = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_PENDING_STATE_PERSISTENCE_FAILED;
				} else {
					_data_->_tmp55_ = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NEW_SESSION_UNCONFIRMED;
				}
				if (_data_->persistence_failed) {
					_data_->_tmp56_ = "Steam restarted, but clearing verified pending state could not be pers" \
"isted.";
				} else {
					_data_->_tmp56_ = "A new Steam process was observed but pending state did not reconcile.";
				}
				_data_->_tmp57_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, _data_->_tmp55_, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp56_);
				_data_->result = _data_->_tmp57_;
				_g_object_unref0 (_data_->observed);
				_g_object_unref0 (_data_->launch_result);
				_g_object_unref0 (_data_->launch);
				_g_object_unref0 (_data_->cancellable);
				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;
			}
			proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_SUCCEEDED);
			if (_data_->persistence_failed) {
				_data_->_tmp58_ = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_PENDING_STATE_PERSISTENCE_FAILED;
			} else {
				_data_->_tmp58_ = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE;
			}
			if (_data_->persistence_failed) {
				_data_->_tmp59_ = "Steam restarted, but persistence of cleared pending state failed.";
			} else {
				_data_->_tmp59_ = "A new confirmed Steam session reconciled all pending records for this " \
"target.";
			}
			_data_->_tmp60_ = _data_->observed;
			_data_->_tmp61_ = proton_plus_services_steam_restart_orchestrator_result (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_SUCCEEDED, _data_->_tmp58_, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->cleared, _data_->persistence_failed, _data_->_tmp60_, _data_->_tmp59_);
			_data_->result = _data_->_tmp61_;
			_g_object_unref0 (_data_->observed);
			_g_object_unref0 (_data_->launch_result);
			_g_object_unref0 (_data_->launch);
			_g_object_unref0 (_data_->cancellable);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp65_ = proton_plus_models_steam_restart_target_get_installation_kind (_data_->target);
		_data_->_tmp66_ = _data_->_tmp65_;
		if (_data_->_tmp66_ == PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_NATIVE) {
			_data_->_tmp64_ = _data_->update_observed;
		} else {
			_data_->_tmp64_ = FALSE;
		}
		if (_data_->_tmp64_) {
			_data_->_tmp63_ = !_data_->update_relaunch_sent;
		} else {
			_data_->_tmp63_ = FALSE;
		}
		if (_data_->_tmp63_) {
			_data_->_tmp67_ = _data_->observed;
			_data_->_tmp62_ = proton_plus_services_steam_restart_orchestrator_is_confirmed_stopped (_data_->self, _data_->_tmp67_);
		} else {
			_data_->_tmp62_ = FALSE;
		}
		if (_data_->_tmp62_) {
			_data_->update_relaunch_sent = TRUE;
			proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_LAUNCHING);
			_data_->_tmp68_ = _data_->cancellable;
			_data_->_state_ = 2;
			proton_plus_services_steam_restart_orchestrator_dispatch_launch (_data_->self, _data_->target, _data_->_tmp68_, proton_plus_services_steam_restart_orchestrator_launch_and_wait_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp69_ = proton_plus_services_steam_restart_orchestrator_dispatch_launch_finish (_data_->self, _data_->_res_);
			_data_->retry = _data_->_tmp69_;
			_data_->_tmp70_ = _data_->retry;
			if (_data_->_tmp70_ == NULL) {
				_data_->_tmp71_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Updater recovery launch was cancelled before a command result was avai" \
"lable.");
				_data_->result = _data_->_tmp71_;
				_g_object_unref0 (_data_->retry);
				_g_object_unref0 (_data_->observed);
				_g_object_unref0 (_data_->launch_result);
				_g_object_unref0 (_data_->launch);
				_g_object_unref0 (_data_->cancellable);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp72_ = _data_->retry;
			_data_->_tmp73_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp72_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_COMMAND_RESULT, ProtonPlusServicesSteamRestartCommandResult));
			_data_->retry_result = _data_->_tmp73_;
			_data_->_tmp75_ = _data_->retry_result;
			_data_->_tmp76_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp75_);
			_data_->_tmp77_ = _data_->_tmp76_;
			if (_data_->_tmp77_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
				_data_->_tmp74_ = TRUE;
			} else {
				_data_->_tmp78_ = _data_->retry_result;
				_data_->_tmp79_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp78_);
				_data_->_tmp80_ = _data_->_tmp79_;
				_data_->_tmp74_ = _data_->_tmp80_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED;
			}
			_data_->launch_sent |= _data_->_tmp74_;
			_data_->_tmp82_ = _data_->retry_result;
			_data_->_tmp83_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp82_);
			_data_->_tmp84_ = _data_->_tmp83_;
			if (_data_->_tmp84_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_CANCELLED) {
				_data_->_tmp81_ = TRUE;
			} else {
				_data_->_tmp85_ = _data_->cancellable;
				_data_->_tmp81_ = proton_plus_services_steam_restart_orchestrator_cancelled (_data_->self, _data_->_tmp85_);
			}
			if (_data_->_tmp81_) {
				_data_->_tmp86_ = _data_->retry_result;
				_data_->_tmp87_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp86_);
				_data_->_tmp88_ = _data_->_tmp87_;
				_data_->_tmp89_ = g_strconcat ("Updater recovery launch may have been requested before cancellation: ", _data_->_tmp88_, NULL);
				_data_->_tmp90_ = _data_->_tmp89_;
				_data_->_tmp91_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp90_);
				_data_->_tmp92_ = _data_->_tmp91_;
				_g_free0 (_data_->_tmp90_);
				_data_->result = _data_->_tmp92_;
				_g_object_unref0 (_data_->retry_result);
				_g_object_unref0 (_data_->retry);
				_g_object_unref0 (_data_->observed);
				_g_object_unref0 (_data_->launch_result);
				_g_object_unref0 (_data_->launch);
				_g_object_unref0 (_data_->cancellable);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp93_ = _data_->retry_result;
			_data_->_tmp94_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp93_);
			_data_->_tmp95_ = _data_->_tmp94_;
			if (_data_->_tmp95_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_UNAVAILABLE) {
				_data_->_tmp96_ = _data_->retry_result;
				_data_->_tmp97_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp96_);
				_data_->_tmp98_ = _data_->_tmp97_;
				_data_->_tmp99_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_RELAUNCH_UNAVAILABLE, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp98_);
				_data_->result = _data_->_tmp99_;
				_g_object_unref0 (_data_->retry_result);
				_g_object_unref0 (_data_->retry);
				_g_object_unref0 (_data_->observed);
				_g_object_unref0 (_data_->launch_result);
				_g_object_unref0 (_data_->launch);
				_g_object_unref0 (_data_->cancellable);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp100_ = _data_->retry_result;
			_data_->_tmp101_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp100_);
			_data_->_tmp102_ = _data_->_tmp101_;
			if (_data_->_tmp102_ != PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_ACCEPTED) {
				_data_->_tmp103_ = _data_->retry_result;
				_data_->_tmp104_ = proton_plus_services_steam_restart_command_result_get_diagnostic (_data_->_tmp103_);
				_data_->_tmp105_ = _data_->_tmp104_;
				_data_->_tmp106_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_RELAUNCH_FAILED, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, _data_->_tmp105_);
				_data_->result = _data_->_tmp106_;
				_g_object_unref0 (_data_->retry_result);
				_g_object_unref0 (_data_->retry);
				_g_object_unref0 (_data_->observed);
				_g_object_unref0 (_data_->launch_result);
				_g_object_unref0 (_data_->launch);
				_g_object_unref0 (_data_->cancellable);
				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;
			}
			proton_plus_services_steam_restart_orchestrator_transition (_data_->self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_WAITING_FOR_START);
			_data_->poll = (guint) 0;
			_g_object_unref0 (_data_->retry_result);
			_g_object_unref0 (_data_->retry);
			_g_object_unref0 (_data_->observed);
			continue;
		}
		_data_->_tmp107_ = _data_->self->priv->backend;
		_data_->_tmp108_ = _data_->cancellable;
		_data_->_state_ = 3;
		proton_plus_services_steam_restart_backend_delay (_data_->_tmp107_, _data_->self->priv->poll_interval_msec, _data_->_tmp108_, proton_plus_services_steam_restart_orchestrator_launch_and_wait_ready, _data_);
		return FALSE;
		_state_3:
		if (!proton_plus_services_steam_restart_backend_delay_finish (_data_->_tmp107_, _data_->_res_)) {
			_data_->_tmp109_ = proton_plus_services_steam_restart_orchestrator_cancelled_result (_data_->self, _data_->target, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Launch was dispatched; startup polling was cancelled.");
			_data_->result = _data_->_tmp109_;
			_g_object_unref0 (_data_->observed);
			_g_object_unref0 (_data_->launch_result);
			_g_object_unref0 (_data_->launch);
			_g_object_unref0 (_data_->cancellable);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp110_ = _data_->poll;
		_data_->poll = _data_->_tmp110_ + 1;
		_g_object_unref0 (_data_->observed);
	}
	_data_->_tmp111_ = proton_plus_services_steam_restart_orchestrator_fail (_data_->self, _data_->target, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_START_TIMEOUT, _data_->shutdown_sent, _data_->stopped, _data_->launch_sent, _data_->started, "Launch was requested but a new confirmed Steam session was not observe" \
"d.");
	_data_->result = _data_->_tmp111_;
	_g_object_unref0 (_data_->launch_result);
	_g_object_unref0 (_data_->launch);
	_g_object_unref0 (_data_->cancellable);
	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_restart_orchestrator_dispatch_launch_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_dispatch_launch (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                 ProtonPlusModelsSteamRestartTarget* target,
                                                                 GCancellable* cancellable,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_restart_orchestrator_dispatch_launch_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	proton_plus_services_steam_restart_orchestrator_dispatch_launch_co (_data_);
}

static ProtonPlusServicesSteamRestartCommandResult*
proton_plus_services_steam_restart_orchestrator_dispatch_launch_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                        GAsyncResult* _res_)
{
	ProtonPlusServicesSteamRestartCommandResult* result;
	ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_dispatch_launch_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_dispatch_launch_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_dispatch_launch_co (ProtonPlusServicesSteamRestartOrchestratorDispatchLaunchData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_models_steam_restart_target_get_installation_kind (_data_->target);
	_data_->_tmp1_ = _data_->_tmp0_;
	switch (_data_->_tmp1_) {
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_NATIVE:
		{
			_data_->_tmp2_ = _data_->self->priv->backend;
			_data_->_state_ = 1;
			proton_plus_services_steam_restart_backend_launch_desktop_application (_data_->_tmp2_, "steam.desktop", _data_->cancellable, proton_plus_services_steam_restart_orchestrator_dispatch_launch_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp3_ = proton_plus_services_steam_restart_backend_launch_desktop_application_finish (_data_->_tmp2_, _data_->_res_);
			_g_object_unref0 (_data_->launch);
			_data_->launch = _data_->_tmp3_;
			_data_->_tmp5_ = _data_->launch;
			if (_data_->_tmp5_ != NULL) {
				_data_->_tmp6_ = _data_->launch;
				_data_->_tmp7_ = proton_plus_services_steam_restart_command_result_get_status (_data_->_tmp6_);
				_data_->_tmp8_ = _data_->_tmp7_;
				_data_->_tmp4_ = _data_->_tmp8_ == PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_UNAVAILABLE;
			} else {
				_data_->_tmp4_ = FALSE;
			}
			if (_data_->_tmp4_) {
				_data_->_tmp9_ = _data_->self->priv->backend;
				_data_->_state_ = 2;
				proton_plus_services_steam_restart_backend_launch_native_fallback (_data_->_tmp9_, _data_->cancellable, proton_plus_services_steam_restart_orchestrator_dispatch_launch_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp10_ = proton_plus_services_steam_restart_backend_launch_native_fallback_finish (_data_->_tmp9_, _data_->_res_);
				_g_object_unref0 (_data_->launch);
				_data_->launch = _data_->_tmp10_;
			}
			_data_->result = _data_->launch;
			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;
		}
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_FLATPAK:
		{
			_data_->_tmp11_ = _data_->self->priv->backend;
			_data_->_state_ = 3;
			proton_plus_services_steam_restart_backend_launch_desktop_application (_data_->_tmp11_, "com.valvesoftware.Steam.desktop", _data_->cancellable, proton_plus_services_steam_restart_orchestrator_dispatch_launch_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp12_ = proton_plus_services_steam_restart_backend_launch_desktop_application_finish (_data_->_tmp11_, _data_->_res_);
			_data_->result = _data_->_tmp12_;
			_g_object_unref0 (_data_->launch);
			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;
		}
		default:
		{
			_data_->_tmp13_ = proton_plus_services_steam_restart_command_result_new (PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_UNAVAILABLE, NULL, "This installation kind has no validated relaunch strategy.");
			_data_->result = _data_->_tmp13_;
			_g_object_unref0 (_data_->launch);
			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_restart_orchestrator_dispatch_shutdown_data_free (gpointer _data)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData, _data_);
}

static void
proton_plus_services_steam_restart_orchestrator_dispatch_shutdown (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                   ProtonPlusModelsSteamRestartTarget* target,
                                                                   GCancellable* cancellable,
                                                                   GAsyncReadyCallback _callback_,
                                                                   gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartTarget* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_co (_data_);
}

static ProtonPlusServicesSteamRestartCommandResult*
proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                          GAsyncResult* _res_)
{
	ProtonPlusServicesSteamRestartCommandResult* result;
	ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_co (_data_);
}

static gboolean
proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_co (ProtonPlusServicesSteamRestartOrchestratorDispatchShutdownData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_models_steam_restart_target_get_installation_kind (_data_->target);
	_data_->_tmp1_ = _data_->_tmp0_;
	switch (_data_->_tmp1_) {
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_NATIVE:
		{
			_data_->_tmp2_ = _data_->self->priv->backend;
			_data_->_state_ = 1;
			proton_plus_services_steam_restart_backend_request_native_shutdown (_data_->_tmp2_, proton_plus_globals_IS_FLATPAK, _data_->cancellable, proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp3_ = proton_plus_services_steam_restart_backend_request_native_shutdown_finish (_data_->_tmp2_, _data_->_res_);
			_data_->result = _data_->_tmp3_;
			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;
		}
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_FLATPAK:
		{
			_data_->_tmp4_ = _data_->self->priv->backend;
			_data_->_state_ = 2;
			proton_plus_services_steam_restart_backend_request_flatpak_shutdown (_data_->_tmp4_, proton_plus_globals_IS_FLATPAK, _data_->cancellable, proton_plus_services_steam_restart_orchestrator_dispatch_shutdown_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp5_ = proton_plus_services_steam_restart_backend_request_flatpak_shutdown_finish (_data_->_tmp4_, _data_->_res_);
			_data_->result = _data_->_tmp5_;
			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;
		}
		default:
		{
			_data_->_tmp6_ = proton_plus_services_steam_restart_command_result_new (PROTON_PLUS_SERVICES_STEAM_RESTART_COMMAND_STATUS_UNAVAILABLE, NULL, "This installation kind has no validated graceful shutdown strategy.");
			_data_->result = _data_->_tmp6_;
			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 ProtonPlusServicesSteamSessionSnapshot*
proton_plus_services_steam_restart_orchestrator_observe (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                         ProtonPlusModelsSteamRestartTarget* target,
                                                         gboolean reconcile)
{
	ProtonPlusServicesSteamSessionSnapshot* snapshot = NULL;
	ProtonPlusServicesSteamSessionService* _tmp0_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp1_;
	ProtonPlusServicesSteamSessionSnapshot* _tmp2_;
	gboolean _tmp3_ = FALSE;
	ProtonPlusServicesSteamSessionSnapshot* _tmp11_;
	ProtonPlusServicesSteamSessionSnapshot* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	_tmp0_ = self->priv->session_service;
	_tmp1_ = proton_plus_services_steam_session_service_inspect (_tmp0_, target);
	snapshot = _tmp1_;
	_tmp2_ = snapshot;
	proton_plus_services_steam_restart_orchestrator_set_last_snapshot (self, _tmp2_);
	if (reconcile) {
		ProtonPlusServicesSteamSessionSnapshot* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp4_ = snapshot;
		_tmp5_ = proton_plus_services_steam_session_snapshot_get_target_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = proton_plus_models_steam_restart_target_get_id (target);
		_tmp8_ = _tmp7_;
		_tmp3_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		ProtonPlusServicesSteamRestartManager* _tmp9_;
		ProtonPlusServicesSteamSessionSnapshot* _tmp10_;
		_tmp9_ = self->priv->restart_manager;
		_tmp10_ = snapshot;
		proton_plus_services_steam_restart_manager_reconcile_snapshot (_tmp9_, target, _tmp10_);
	}
	_tmp11_ = snapshot;
	g_signal_emit (self, proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_PROGRESS_CHANGED_SIGNAL], 0, _tmp11_);
	result = snapshot;
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_target_has_configuration_intent (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                                 ProtonPlusModelsSteamRestartTarget* target)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	{
		GeeList* _record_list = NULL;
		ProtonPlusServicesSteamRestartManager* _tmp0_;
		GeeList* _tmp1_;
		gint _record_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _record_index = 0;
		_tmp0_ = self->priv->restart_manager;
		_tmp1_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp0_, target);
		_record_list = _tmp1_;
		_tmp2_ = _record_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_record_size = _tmp4_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp9_;
			ProtonPlusModelsSteamChangeReceipt* _tmp10_;
			ProtonPlusModelsSteamChangeReceipt* _tmp11_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp12_;
			ProtonPlusModelsSteamConfigurationIntent* _tmp13_;
			_record_index = _record_index + 1;
			_tmp5_ = _record_index;
			_tmp6_ = _record_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _record_list;
			_tmp8_ = gee_list_get (_tmp7_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp8_;
			_tmp9_ = record;
			_tmp10_ = proton_plus_models_steam_restart_pending_record_get_receipt (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = proton_plus_models_steam_change_receipt_get_configuration_intent (_tmp11_);
			_tmp13_ = _tmp12_;
			if (_tmp13_ != NULL) {
				result = TRUE;
				_g_object_unref0 (record);
				_g_object_unref0 (_record_list);
				return result;
			}
			_g_object_unref0 (record);
		}
		_g_object_unref0 (_record_list);
	}
	result = FALSE;
	return result;
}

static ProtonPlusModelsSteamRestartFailureReason
proton_plus_services_steam_restart_orchestrator_reject_preflight (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                  ProtonPlusModelsSteamRestartTarget* target,
                                                                  ProtonPlusServicesSteamSessionSnapshot* snapshot,
                                                                  gboolean allow_game_processes)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	ProtonPlusServicesSteamSessionState _tmp5_;
	ProtonPlusServicesSteamSessionState _tmp6_;
	ProtonPlusServicesSteamSessionState _tmp9_;
	ProtonPlusServicesSteamSessionState _tmp10_;
	ProtonPlusServicesSteamSessionState _tmp11_;
	ProtonPlusServicesSteamSessionState _tmp12_;
	ProtonPlusModelsSteamRestartFailureReason result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (target != NULL, 0);
	g_return_val_if_fail (snapshot != NULL, 0);
	_tmp0_ = proton_plus_services_steam_session_snapshot_get_target_id (snapshot);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_steam_restart_target_get_id (target);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) != 0) {
		result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_TARGET_SNAPSHOT_MISMATCH;
		return result;
	}
	_tmp5_ = proton_plus_services_steam_session_snapshot_get_state (snapshot);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_UNKNOWN) {
		_tmp4_ = TRUE;
	} else {
		ProtonPlusServicesSteamEvidenceLevel _tmp7_;
		ProtonPlusServicesSteamEvidenceLevel _tmp8_;
		_tmp7_ = proton_plus_services_steam_session_snapshot_get_state_confidence (snapshot);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_ != PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	}
	if (_tmp4_) {
		result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STATE_UNKNOWN_OR_AMBIGUOUS;
		return result;
	}
	_tmp9_ = proton_plus_services_steam_session_snapshot_get_state (snapshot);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STARTING) {
		result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAM_STARTING;
		return result;
	}
	_tmp11_ = proton_plus_services_steam_session_snapshot_get_state (snapshot);
	_tmp12_ = _tmp11_;
	if (_tmp12_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_UPDATING) {
		result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_STEAM_UPDATING;
		return result;
	}
	{
		GeeList* _blocker_list = NULL;
		GeeList* _tmp13_;
		GeeList* _tmp14_;
		gint _blocker_size = 0;
		GeeList* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gint _blocker_index = 0;
		_tmp13_ = proton_plus_services_steam_session_snapshot_get_blockers (snapshot);
		_tmp14_ = _tmp13_;
		_blocker_list = _tmp14_;
		_tmp15_ = _blocker_list;
		_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
		_tmp17_ = _tmp16_;
		_blocker_size = _tmp17_;
		_blocker_index = -1;
		while (TRUE) {
			gint _tmp18_;
			gint _tmp19_;
			ProtonPlusServicesSteamSessionBlockerEvidence* blocker = NULL;
			GeeList* _tmp20_;
			gpointer _tmp21_;
			gboolean _tmp22_ = FALSE;
			ProtonPlusServicesSteamSessionBlockerEvidence* _tmp23_;
			ProtonPlusServicesSteamSessionBlocker _tmp24_;
			ProtonPlusServicesSteamSessionBlocker _tmp25_;
			ProtonPlusServicesSteamSessionBlockerEvidence* _tmp26_;
			ProtonPlusServicesSteamSessionBlocker _tmp27_;
			ProtonPlusServicesSteamSessionBlocker _tmp28_;
			ProtonPlusServicesSteamSessionBlockerEvidence* _tmp29_;
			ProtonPlusServicesSteamSessionBlocker _tmp30_;
			ProtonPlusServicesSteamSessionBlocker _tmp31_;
			_blocker_index = _blocker_index + 1;
			_tmp18_ = _blocker_index;
			_tmp19_ = _blocker_size;
			if (!(_tmp18_ < _tmp19_)) {
				break;
			}
			_tmp20_ = _blocker_list;
			_tmp21_ = gee_list_get (_tmp20_, _blocker_index);
			blocker = (ProtonPlusServicesSteamSessionBlockerEvidence*) _tmp21_;
			_tmp23_ = blocker;
			_tmp24_ = proton_plus_services_steam_session_blocker_evidence_get_blocker (_tmp23_);
			_tmp25_ = _tmp24_;
			if (_tmp25_ == PROTON_PLUS_SERVICES_STEAM_SESSION_BLOCKER_GAME_OR_COMPATIBILITY_PROCESS) {
				_tmp22_ = allow_game_processes;
			} else {
				_tmp22_ = FALSE;
			}
			if (_tmp22_) {
				_g_object_unref0 (blocker);
				continue;
			}
			_tmp26_ = blocker;
			_tmp27_ = proton_plus_services_steam_session_blocker_evidence_get_blocker (_tmp26_);
			_tmp28_ = _tmp27_;
			if (_tmp28_ == PROTON_PLUS_SERVICES_STEAM_SESSION_BLOCKER_GAME_OR_COMPATIBILITY_PROCESS) {
				result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_GAME_OR_COMPATIBILITY_PROCESS;
				_g_object_unref0 (blocker);
				return result;
			}
			_tmp29_ = blocker;
			_tmp30_ = proton_plus_services_steam_session_blocker_evidence_get_blocker (_tmp29_);
			_tmp31_ = _tmp30_;
			if (_tmp31_ != PROTON_PLUS_SERVICES_STEAM_SESSION_BLOCKER_NONE) {
				result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_SESSION_BLOCKER;
				_g_object_unref0 (blocker);
				return result;
			}
			_g_object_unref0 (blocker);
		}
	}
	result = PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_NONE;
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_is_confirmed_stopped (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                      ProtonPlusServicesSteamSessionSnapshot* snapshot)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusServicesSteamSessionState _tmp1_;
	ProtonPlusServicesSteamSessionState _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (snapshot != NULL, FALSE);
	_tmp1_ = proton_plus_services_steam_session_snapshot_get_state (snapshot);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_STOPPED) {
		ProtonPlusServicesSteamEvidenceLevel _tmp3_;
		ProtonPlusServicesSteamEvidenceLevel _tmp4_;
		_tmp3_ = proton_plus_services_steam_session_snapshot_get_state_confidence (snapshot);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_has_relaunch_strategy (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                       ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusModelsSteamInstallationKind _tmp0_;
	ProtonPlusModelsSteamInstallationKind _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = proton_plus_models_steam_restart_target_get_installation_kind (target);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_NATIVE:
		{
			gboolean _tmp2_ = FALSE;
			ProtonPlusServicesSteamRestartBackend* _tmp3_;
			_tmp3_ = self->priv->backend;
			if (proton_plus_services_steam_restart_backend_has_desktop_application (_tmp3_, "steam.desktop")) {
				_tmp2_ = TRUE;
			} else {
				ProtonPlusServicesSteamRestartBackend* _tmp4_;
				_tmp4_ = self->priv->backend;
				_tmp2_ = proton_plus_services_steam_restart_backend_has_native_fallback (_tmp4_);
			}
			result = _tmp2_;
			return result;
		}
		case PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_FLATPAK:
		{
			ProtonPlusServicesSteamRestartBackend* _tmp5_;
			_tmp5_ = self->priv->backend;
			result = proton_plus_services_steam_restart_backend_has_desktop_application (_tmp5_, "com.valvesoftware.Steam.desktop");
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static ProtonPlusModelsSteamSessionIdentity*
proton_plus_services_steam_restart_orchestrator_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                          ProtonPlusModelsSteamRestartTarget* target,
                                                          ProtonPlusServicesSteamSessionSnapshot* snapshot)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusServicesSteamSessionState _tmp1_;
	ProtonPlusServicesSteamSessionState _tmp2_;
	ProtonPlusModelsSteamInstallationKind _tmp5_;
	ProtonPlusModelsSteamInstallationKind _tmp6_;
	ProtonPlusServicesSteamProcessGeneration* _tmp15_;
	ProtonPlusServicesSteamProcessGeneration* _tmp16_;
	ProtonPlusServicesSteamProcessGeneration* generation = NULL;
	ProtonPlusServicesSteamProcessGeneration* _tmp17_;
	ProtonPlusServicesSteamProcessGeneration* _tmp18_;
	ProtonPlusServicesSteamProcessGeneration* _tmp19_;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	ProtonPlusServicesSteamProcessGeneration* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	ProtonPlusServicesSteamProcessGeneration* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	ProtonPlusServicesSteamProcessGeneration* _tmp38_;
	gint64 _tmp39_;
	gint64 _tmp40_;
	ProtonPlusServicesSteamProcessGeneration* _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	ProtonPlusModelsSteamSessionIdentity* _tmp44_;
	ProtonPlusModelsSteamSessionIdentity* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (snapshot != NULL, NULL);
	_tmp1_ = proton_plus_services_steam_session_snapshot_get_state (snapshot);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != PROTON_PLUS_SERVICES_STEAM_SESSION_STATE_RUNNING) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesSteamEvidenceLevel _tmp3_;
		ProtonPlusServicesSteamEvidenceLevel _tmp4_;
		_tmp3_ = proton_plus_services_steam_session_snapshot_get_state_confidence (snapshot);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ != PROTON_PLUS_SERVICES_STEAM_EVIDENCE_LEVEL_CONFIRMED;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp5_ = proton_plus_models_steam_restart_target_get_installation_kind (target);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == PROTON_PLUS_MODELS_STEAM_INSTALLATION_KIND_FLATPAK) {
		gboolean _tmp7_ = FALSE;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		ProtonPlusModelsSteamSessionIdentity* _tmp14_;
		_tmp8_ = proton_plus_services_steam_session_snapshot_get_flatpak_instance_id (snapshot);
		_tmp9_ = _tmp8_;
		if (_tmp9_ == NULL) {
			_tmp7_ = TRUE;
		} else {
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp10_ = proton_plus_services_steam_session_snapshot_get_flatpak_instance_id (snapshot);
			_tmp11_ = _tmp10_;
			_tmp7_ = g_strcmp0 (_tmp11_, "") == 0;
		}
		if (_tmp7_) {
			result = NULL;
			return result;
		}
		_tmp12_ = proton_plus_services_steam_session_snapshot_get_flatpak_instance_id (snapshot);
		_tmp13_ = _tmp12_;
		_tmp14_ = proton_plus_models_steam_session_identity_new (NULL, (gint64) 0, 0, _tmp13_);
		result = _tmp14_;
		return result;
	}
	_tmp15_ = proton_plus_services_steam_session_snapshot_get_generation (snapshot);
	_tmp16_ = _tmp15_;
	if (_tmp16_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp17_ = proton_plus_services_steam_session_snapshot_get_generation (snapshot);
	_tmp18_ = _tmp17_;
	_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, PROTON_PLUS_SERVICES_TYPE_STEAM_PROCESS_GENERATION, ProtonPlusServicesSteamProcessGeneration));
	generation = _tmp19_;
	_tmp23_ = generation;
	_tmp24_ = proton_plus_services_steam_process_generation_get_boot_id (_tmp23_);
	_tmp25_ = _tmp24_;
	if (_tmp25_ == NULL) {
		_tmp22_ = TRUE;
	} else {
		ProtonPlusServicesSteamProcessGeneration* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		_tmp26_ = generation;
		_tmp27_ = proton_plus_services_steam_process_generation_get_boot_id (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp22_ = g_strcmp0 (_tmp28_, "") == 0;
	}
	if (_tmp22_) {
		_tmp21_ = TRUE;
	} else {
		ProtonPlusServicesSteamProcessGeneration* _tmp29_;
		gint64 _tmp30_;
		gint64 _tmp31_;
		_tmp29_ = generation;
		_tmp30_ = proton_plus_services_steam_process_generation_get_start_time_ticks (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp21_ = _tmp31_ <= ((gint64) 0);
	}
	if (_tmp21_) {
		_tmp20_ = TRUE;
	} else {
		ProtonPlusServicesSteamProcessGeneration* _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		_tmp32_ = generation;
		_tmp33_ = proton_plus_services_steam_process_generation_get_pid (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp20_ = _tmp34_ <= 0;
	}
	if (_tmp20_) {
		result = NULL;
		_g_object_unref0 (generation);
		return result;
	}
	_tmp35_ = generation;
	_tmp36_ = proton_plus_services_steam_process_generation_get_boot_id (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = generation;
	_tmp39_ = proton_plus_services_steam_process_generation_get_start_time_ticks (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = generation;
	_tmp42_ = proton_plus_services_steam_process_generation_get_pid (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = proton_plus_models_steam_session_identity_new (_tmp37_, _tmp40_, _tmp43_, NULL);
	result = _tmp44_;
	_g_object_unref0 (generation);
	return result;
}

static ProtonPlusModelsSteamSessionIdentity*
proton_plus_services_steam_restart_orchestrator_pending_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                  ProtonPlusModelsSteamRestartTarget* target)
{
	ProtonPlusModelsSteamSessionIdentity* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	{
		GeeList* _record_list = NULL;
		ProtonPlusServicesSteamRestartManager* _tmp0_;
		GeeList* _tmp1_;
		gint _record_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _record_index = 0;
		_tmp0_ = self->priv->restart_manager;
		_tmp1_ = proton_plus_services_steam_restart_manager_get_pending_changes_for_target (_tmp0_, target);
		_record_list = _tmp1_;
		_tmp2_ = _record_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_record_size = _tmp4_;
		_record_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusModelsSteamRestartPendingRecord* record = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusModelsSteamRestartPendingRecord* _tmp9_;
			ProtonPlusModelsSteamSessionIdentity* _tmp10_;
			ProtonPlusModelsSteamSessionIdentity* _tmp11_;
			_record_index = _record_index + 1;
			_tmp5_ = _record_index;
			_tmp6_ = _record_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _record_list;
			_tmp8_ = gee_list_get (_tmp7_, _record_index);
			record = (ProtonPlusModelsSteamRestartPendingRecord*) _tmp8_;
			_tmp9_ = record;
			_tmp10_ = proton_plus_models_steam_restart_pending_record_get_observed_session (_tmp9_);
			_tmp11_ = _tmp10_;
			if (_tmp11_ != NULL) {
				ProtonPlusModelsSteamRestartPendingRecord* _tmp12_;
				ProtonPlusModelsSteamSessionIdentity* _tmp13_;
				ProtonPlusModelsSteamSessionIdentity* _tmp14_;
				ProtonPlusModelsSteamSessionIdentity* _tmp15_;
				_tmp12_ = record;
				_tmp13_ = proton_plus_models_steam_restart_pending_record_get_observed_session (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = _g_object_ref0 (_tmp14_);
				result = _tmp15_;
				_g_object_unref0 (record);
				_g_object_unref0 (_record_list);
				return result;
			}
			_g_object_unref0 (record);
		}
		_g_object_unref0 (_record_list);
	}
	result = NULL;
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_same_identity (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                               ProtonPlusModelsSteamSessionIdentity* first,
                                                               ProtonPlusModelsSteamSessionIdentity* second)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (first == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = second == NULL;
	}
	if (_tmp0_) {
		gboolean _tmp1_ = FALSE;
		if (first == NULL) {
			_tmp1_ = second == NULL;
		} else {
			_tmp1_ = FALSE;
		}
		result = _tmp1_;
		return result;
	}
	result = proton_plus_models_steam_session_identity_equals (G_TYPE_CHECK_INSTANCE_CAST (first, PROTON_PLUS_MODELS_TYPE_STEAM_SESSION_IDENTITY, ProtonPlusModelsSteamSessionIdentity), G_TYPE_CHECK_INSTANCE_CAST (second, PROTON_PLUS_MODELS_TYPE_STEAM_SESSION_IDENTITY, ProtonPlusModelsSteamSessionIdentity));
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_is_new_confirmed_session (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                          ProtonPlusModelsSteamRestartTarget* target,
                                                                          ProtonPlusModelsSteamSessionIdentity* original,
                                                                          ProtonPlusServicesSteamSessionSnapshot* observed)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ProtonPlusModelsSteamSessionIdentity* current = NULL;
	ProtonPlusModelsSteamSessionIdentity* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ProtonPlusModelsSteamSessionIdentity* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	g_return_val_if_fail (observed != NULL, FALSE);
	_tmp0_ = proton_plus_services_steam_session_snapshot_get_target_id (observed);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_steam_restart_target_get_id (target);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) != 0) {
		result = FALSE;
		return result;
	}
	_tmp4_ = proton_plus_services_steam_restart_orchestrator_identity (self, target, observed);
	current = _tmp4_;
	_tmp6_ = current;
	if (_tmp6_ != NULL) {
		gboolean _tmp7_ = FALSE;
		if (original == NULL) {
			_tmp7_ = TRUE;
		} else {
			ProtonPlusModelsSteamSessionIdentity* _tmp8_;
			_tmp8_ = current;
			_tmp7_ = !proton_plus_models_steam_session_identity_equals (G_TYPE_CHECK_INSTANCE_CAST (original, PROTON_PLUS_MODELS_TYPE_STEAM_SESSION_IDENTITY, ProtonPlusModelsSteamSessionIdentity), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_MODELS_TYPE_STEAM_SESSION_IDENTITY, ProtonPlusModelsSteamSessionIdentity));
		}
		_tmp5_ = _tmp7_;
	} else {
		_tmp5_ = FALSE;
	}
	result = _tmp5_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_cancelled (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                           GCancellable* cancellable)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (cancellable != NULL) {
		_tmp0_ = g_cancellable_is_cancelled (cancellable);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_services_steam_restart_orchestrator_yield_main_context (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_)
{
	ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData* _data_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData);
	_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_restart_orchestrator_yield_main_context_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_services_steam_restart_orchestrator_yield_main_context_co (_data_);
}

static void
proton_plus_services_steam_restart_orchestrator_yield_main_context_finish (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                           GAsyncResult* _res_)
{
	ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block66Data*
block66_data_ref (Block66Data* _data66_)
{
	g_atomic_int_inc (&_data66_->_ref_count_);
	return _data66_;
}

static void
block66_data_unref (void * _userdata_)
{
	Block66Data* _data66_;
	_data66_ = (Block66Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data66_->_ref_count_)) {
		ProtonPlusServicesSteamRestartOrchestrator* self;
		self = _data66_->self;
		_g_object_unref0 (self);
		g_slice_free (Block66Data, _data66_);
	}
}

static gboolean
__lambda346_ (Block66Data* _data66_)
{
	ProtonPlusServicesSteamRestartOrchestrator* self;
	gboolean result;
	self = _data66_->self;
	proton_plus_services_steam_restart_orchestrator_yield_main_context_co (_data66_->_async_data_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda346__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda346_ (self);
	return result;
}

static gboolean
proton_plus_services_steam_restart_orchestrator_yield_main_context_co (ProtonPlusServicesSteamRestartOrchestratorYieldMainContextData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data66_ = g_slice_new0 (Block66Data);
	_data_->_data66_->_ref_count_ = 1;
	_data_->_data66_->self = g_object_ref (_data_->self);
	_data_->_data66_->_async_data_ = _data_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda346__gsource_func, block66_data_ref (_data_->_data66_), block66_data_unref);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block66_data_unref (_data_->_data66_);
	_data_->_data66_ = NULL;
	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_restart_orchestrator_transition (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                            ProtonPlusModelsSteamRestartOperationState next)
{
	ProtonPlusModelsSteamRestartOperationState _tmp0_;
	g_return_if_fail (self != NULL);
	proton_plus_services_steam_restart_orchestrator_set_state (self, next);
	_tmp0_ = self->priv->_state;
	g_signal_emit (self, proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_CHANGED_SIGNAL], 0, _tmp0_);
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_cancelled_result (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                  ProtonPlusModelsSteamRestartTarget* target,
                                                                  gboolean shutdown,
                                                                  gboolean stopped,
                                                                  gboolean launch,
                                                                  gboolean started,
                                                                  const gchar* detail)
{
	ProtonPlusServicesSteamSessionSnapshot* _tmp0_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (detail != NULL, NULL);
	proton_plus_services_steam_restart_orchestrator_transition (self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_CANCELLED);
	_tmp0_ = self->priv->_last_snapshot;
	_tmp1_ = proton_plus_services_steam_restart_orchestrator_result (self, target, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_CANCELLED, PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_CANCELLED, shutdown, stopped, launch, started, FALSE, FALSE, _tmp0_, detail);
	result = _tmp1_;
	return result;
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_fail (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                      ProtonPlusModelsSteamRestartTarget* target,
                                                      ProtonPlusModelsSteamRestartFailureReason reason,
                                                      gboolean shutdown,
                                                      gboolean stopped,
                                                      gboolean launch,
                                                      gboolean started,
                                                      const gchar* detail)
{
	ProtonPlusServicesSteamSessionSnapshot* _tmp0_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (detail != NULL, NULL);
	proton_plus_services_steam_restart_orchestrator_transition (self, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_FAILED);
	_tmp0_ = self->priv->_last_snapshot;
	_tmp1_ = proton_plus_services_steam_restart_orchestrator_result (self, target, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_FAILED, reason, shutdown, stopped, launch, started, FALSE, FALSE, _tmp0_, detail);
	result = _tmp1_;
	return result;
}

static ProtonPlusModelsSteamRestartOperationResult*
proton_plus_services_steam_restart_orchestrator_result (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                        ProtonPlusModelsSteamRestartTarget* target,
                                                        ProtonPlusModelsSteamRestartOperationState final_state,
                                                        ProtonPlusModelsSteamRestartFailureReason reason,
                                                        gboolean shutdown,
                                                        gboolean stopped,
                                                        gboolean launch,
                                                        gboolean started,
                                                        gboolean cleared,
                                                        gboolean persistence_failed,
                                                        ProtonPlusServicesSteamSessionSnapshot* snapshot,
                                                        const gchar* detail)
{
	ProtonPlusModelsSteamRestartOperationResult* _tmp0_;
	ProtonPlusModelsSteamRestartOperationResult* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (detail != NULL, NULL);
	_tmp0_ = proton_plus_models_steam_restart_operation_result_new (target, final_state, reason, shutdown, stopped, launch, started, cleared, persistence_failed, snapshot, detail);
	result = _tmp0_;
	return result;
}

ProtonPlusModelsSteamRestartOperationState
proton_plus_services_steam_restart_orchestrator_get_state (ProtonPlusServicesSteamRestartOrchestrator* self)
{
	ProtonPlusModelsSteamRestartOperationState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_state;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_set_state (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                           ProtonPlusModelsSteamRestartOperationState value)
{
	ProtonPlusModelsSteamRestartOperationState old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_steam_restart_orchestrator_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY]);
	}
}

ProtonPlusServicesSteamSessionSnapshot*
proton_plus_services_steam_restart_orchestrator_get_last_snapshot (ProtonPlusServicesSteamRestartOrchestrator* self)
{
	ProtonPlusServicesSteamSessionSnapshot* result;
	ProtonPlusServicesSteamSessionSnapshot* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_snapshot;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_set_last_snapshot (ProtonPlusServicesSteamRestartOrchestrator* self,
                                                                   ProtonPlusServicesSteamSessionSnapshot* value)
{
	ProtonPlusServicesSteamSessionSnapshot* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_steam_restart_orchestrator_get_last_snapshot (self);
	if (old_value != value) {
		ProtonPlusServicesSteamSessionSnapshot* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_last_snapshot);
		self->priv->_last_snapshot = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY]);
	}
}

gboolean
proton_plus_services_steam_restart_orchestrator_get_is_operation_active (ProtonPlusServicesSteamRestartOrchestrator* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->operation_active;
	return result;
}

static void
proton_plus_services_steam_restart_orchestrator_class_init (ProtonPlusServicesSteamRestartOrchestratorClass * klass,
                                                            gpointer klass_data)
{
	proton_plus_services_steam_restart_orchestrator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesSteamRestartOrchestrator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_services_steam_restart_orchestrator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_services_steam_restart_orchestrator_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_steam_restart_orchestrator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY, proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", PROTON_PLUS_MODELS_TYPE_STEAM_RESTART_OPERATION_STATE, PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_IDLE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY, proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY] = g_param_spec_object ("last-snapshot", "last-snapshot", "last-snapshot", PROTON_PLUS_SERVICES_TYPE_STEAM_SESSION_SNAPSHOT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_IS_OPERATION_ACTIVE_PROPERTY, proton_plus_services_steam_restart_orchestrator_properties[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_IS_OPERATION_ACTIVE_PROPERTY] = g_param_spec_boolean ("is-operation-active", "is-operation-active", "is-operation-active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_CHANGED_SIGNAL] = g_signal_new ("state-changed", PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, PROTON_PLUS_MODELS_TYPE_STEAM_RESTART_OPERATION_STATE);
	proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_PROGRESS_CHANGED_SIGNAL] = g_signal_new ("progress-changed", PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_SERVICES_TYPE_STEAM_SESSION_SNAPSHOT);
	proton_plus_services_steam_restart_orchestrator_signals[PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_OPERATION_COMPLETED_SIGNAL] = g_signal_new ("operation-completed", PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_MODELS_TYPE_STEAM_RESTART_OPERATION_RESULT);
}

static void
proton_plus_services_steam_restart_orchestrator_instance_init (ProtonPlusServicesSteamRestartOrchestrator * self,
                                                               gpointer klass)
{
	self->priv = proton_plus_services_steam_restart_orchestrator_get_instance_private (self);
	self->priv->operation_active = FALSE;
	self->priv->_state = PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_IDLE;
	self->priv->_last_snapshot = NULL;
}

static void
proton_plus_services_steam_restart_orchestrator_finalize (GObject * obj)
{
	ProtonPlusServicesSteamRestartOrchestrator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, ProtonPlusServicesSteamRestartOrchestrator);
	_g_object_unref0 (self->priv->session_service);
	_g_object_unref0 (self->priv->restart_manager);
	_g_object_unref0 (self->priv->backend);
	_g_object_unref0 (self->priv->configuration_reconciler);
	_g_object_unref0 (self->priv->_last_snapshot);
	G_OBJECT_CLASS (proton_plus_services_steam_restart_orchestrator_parent_class)->finalize (obj);
}

static GType
proton_plus_services_steam_restart_orchestrator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesSteamRestartOrchestratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_steam_restart_orchestrator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesSteamRestartOrchestrator), 0, (GInstanceInitFunc) proton_plus_services_steam_restart_orchestrator_instance_init, NULL };
	GType proton_plus_services_steam_restart_orchestrator_type_id;
	proton_plus_services_steam_restart_orchestrator_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesSteamRestartOrchestrator", &g_define_type_info, 0);
	ProtonPlusServicesSteamRestartOrchestrator_private_offset = g_type_add_instance_private (proton_plus_services_steam_restart_orchestrator_type_id, sizeof (ProtonPlusServicesSteamRestartOrchestratorPrivate));
	return proton_plus_services_steam_restart_orchestrator_type_id;
}

GType
proton_plus_services_steam_restart_orchestrator_get_type (void)
{
	static volatile gsize proton_plus_services_steam_restart_orchestrator_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_steam_restart_orchestrator_type_id__once)) {
		GType proton_plus_services_steam_restart_orchestrator_type_id;
		proton_plus_services_steam_restart_orchestrator_type_id = proton_plus_services_steam_restart_orchestrator_get_type_once ();
		g_once_init_leave (&proton_plus_services_steam_restart_orchestrator_type_id__once, proton_plus_services_steam_restart_orchestrator_type_id);
	}
	return proton_plus_services_steam_restart_orchestrator_type_id__once;
}

static void
_vala_proton_plus_services_steam_restart_orchestrator_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec)
{
	ProtonPlusServicesSteamRestartOrchestrator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, ProtonPlusServicesSteamRestartOrchestrator);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY:
		g_value_set_enum (value, proton_plus_services_steam_restart_orchestrator_get_state (self));
		break;
		case PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY:
		g_value_set_object (value, proton_plus_services_steam_restart_orchestrator_get_last_snapshot (self));
		break;
		case PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_IS_OPERATION_ACTIVE_PROPERTY:
		g_value_set_boolean (value, proton_plus_services_steam_restart_orchestrator_get_is_operation_active (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_services_steam_restart_orchestrator_set_property (GObject * object,
                                                                    guint property_id,
                                                                    const GValue * value,
                                                                    GParamSpec * pspec)
{
	ProtonPlusServicesSteamRestartOrchestrator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, ProtonPlusServicesSteamRestartOrchestrator);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_STATE_PROPERTY:
		proton_plus_services_steam_restart_orchestrator_set_state (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_SERVICES_STEAM_RESTART_ORCHESTRATOR_LAST_SNAPSHOT_PROPERTY:
		proton_plus_services_steam_restart_orchestrator_set_last_snapshot (self, g_value_get_object (value));
		break;
		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;
}

