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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "protonplus_core.h"
#include <stdio.h>
#include <glib-object.h>
#include <stdarg.h>
#include <gobject/gvaluecollector.h>
#include <gee.h>
#include <gio/gio.h>
#include "config.h"
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>

#define PROTON_PLUS_CLI_CMD_VERSION "version"
#define PROTON_PLUS_CLI_CMD_HELP "help"
#define PROTON_PLUS_CLI_CMD_LIST "list"
#define PROTON_PLUS_CLI_CMD_INSTALL "install"
#define PROTON_PLUS_CLI_CMD_UNINSTALL "uninstall"
#define PROTON_PLUS_CLI_CMD_UPDATE "update"
#define PROTON_PLUS_CLI_OPT_LATEST "latest"
#define PROTON_PLUS_CLI_OPT_ALL "all"
#define PROTON_PLUS_CLI_OUTPUT_RESET "\033[0m"
#define PROTON_PLUS_CLI_OUTPUT_BOLD "\033[1m"
#define PROTON_PLUS_CLI_OUTPUT_RED "\033[31m"
#define PROTON_PLUS_CLI_OUTPUT_GREEN "\033[32m"
#define PROTON_PLUS_CLI_OUTPUT_YELLOW "\033[33m"
#define PROTON_PLUS_CLI_OUTPUT_BLUE "\033[34m"
#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_CLI_TERMINAL_CLI_OUTPUT_SINK_0_PROPERTY,
	PROTON_PLUS_CLI_TERMINAL_CLI_OUTPUT_SINK_NUM_PROPERTIES
};
static GParamSpec* proton_plus_cli_terminal_cli_output_sink_properties[PROTON_PLUS_CLI_TERMINAL_CLI_OUTPUT_SINK_NUM_PROPERTIES];
enum  {
	PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_0_PROPERTY,
	PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY,
	PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY,
	PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_NUM_PROPERTIES
};
static GParamSpec* proton_plus_cli_recording_cli_output_sink_properties[PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define PROTON_PLUS_CLI_TYPE_OUTPUT (proton_plus_cli_output_get_type ())
#define PROTON_PLUS_CLI_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_CLI_TYPE_OUTPUT, ProtonPlusCLIOutput))
#define PROTON_PLUS_CLI_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_CLI_TYPE_OUTPUT, ProtonPlusCLIOutputClass))
#define PROTON_PLUS_CLI_IS_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_CLI_TYPE_OUTPUT))
#define PROTON_PLUS_CLI_IS_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_CLI_TYPE_OUTPUT))
#define PROTON_PLUS_CLI_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_CLI_TYPE_OUTPUT, ProtonPlusCLIOutputClass))

typedef struct _ProtonPlusCLIOutput ProtonPlusCLIOutput;
typedef struct _ProtonPlusCLIOutputClass ProtonPlusCLIOutputClass;
typedef struct _ProtonPlusCLIOutputPrivate ProtonPlusCLIOutputPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusCLIParamSpecOutput ProtonPlusCLIParamSpecOutput;
#define _proton_plus_cli_output_unref0(var) ((var == NULL) ? NULL : (var = (proton_plus_cli_output_unref (var), NULL)))
#define _proton_plus_cli_handler_unref0(var) ((var == NULL) ? NULL : (var = (proton_plus_cli_handler_unref (var), NULL)))
typedef struct _ProtonPlusCliHandlerRunData ProtonPlusCliHandlerRunData;
typedef struct _ProtonPlusCliHandlerHandleInstallData ProtonPlusCliHandlerHandleInstallData;
typedef struct _ProtonPlusCliHandlerHandleUninstallData ProtonPlusCliHandlerHandleUninstallData;
typedef struct _ProtonPlusCliHandlerHandleUpdateData ProtonPlusCliHandlerHandleUpdateData;
typedef struct _ProtonPlusCliHandlerInstallLatestData ProtonPlusCliHandlerInstallLatestData;
typedef struct _ProtonPlusCliHandlerInstallInteractiveData ProtonPlusCliHandlerInstallInteractiveData;
typedef struct _ProtonPlusCliHandlerUninstallInteractiveData ProtonPlusCliHandlerUninstallInteractiveData;
typedef struct _ProtonPlusCliHandlerUninstallRunnerAllData ProtonPlusCliHandlerUninstallRunnerAllData;
typedef struct _ProtonPlusCliHandlerUninstallLauncherAllData ProtonPlusCliHandlerUninstallLauncherAllData;
typedef struct _ProtonPlusCliHandlerUninstallSingleReleaseData ProtonPlusCliHandlerUninstallSingleReleaseData;
typedef struct _ProtonPlusCliHandlerUpdateAllData ProtonPlusCliHandlerUpdateAllData;
typedef struct _ProtonPlusCliHandlerUpdateLauncherData ProtonPlusCliHandlerUpdateLauncherData;
typedef struct _ProtonPlusCliHandlerUpdateRunnerData ProtonPlusCliHandlerUpdateRunnerData;
typedef struct _ProtonPlusCliHandlerUpdateRunnerBatchData ProtonPlusCliHandlerUpdateRunnerBatchData;
typedef struct _ProtonPlusCliHandlerUpdateRunnerWithProgressData ProtonPlusCliHandlerUpdateRunnerWithProgressData;
typedef struct _ProtonPlusCliHandlerLoadLaunchersData ProtonPlusCliHandlerLoadLaunchersData;
typedef struct _ProtonPlusCliHandlerLoadRunnerReleasesData ProtonPlusCliHandlerLoadRunnerReleasesData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _ProtonPlusCLIParamSpecHandler ProtonPlusCLIParamSpecHandler;

struct _ProtonPlusCLIRecordingCliOutputSinkPrivate {
	gchar* _stdout_text;
	gchar* _stderr_text;
};

struct _ProtonPlusCLIOutput {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ProtonPlusCLIOutputPrivate * priv;
};

struct _ProtonPlusCLIOutputClass {
	GTypeClass parent_class;
	void (*finalize) (ProtonPlusCLIOutput *self);
};

struct _ProtonPlusCLIOutputPrivate {
	ProtonPlusCLICliOutputSink* sink;
};

struct _ProtonPlusCLIParamSpecOutput {
	GParamSpec parent_instance;
};

struct _ProtonPlusCLIHandlerPrivate {
	GeeLinkedList* launchers;
	GeeLinkedList* fixture_launchers;
	gulong progress_updated_handler_id;
	gulong steam_restart_recording_failed_handler_id;
	ProtonPlusCLIOutput* output;
	ProtonPlusCLICliOutputSink* _output_sink;
};

struct _ProtonPlusCliHandlerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gchar** args;
	gint args_length1;
	gint result;
	gchar* command;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	ProtonPlusCLIOutput* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	ProtonPlusCLIOutput* _tmp12_;
	const gchar* _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	ProtonPlusUtilsDownloadManager* _tmp17_;
	ProtonPlusUtilsDownloadManager* _tmp18_;
	gulong _tmp19_;
	gboolean _tmp20_;
	gboolean _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	ProtonPlusServicesInstallationService* _tmp25_;
	ProtonPlusServicesInstallationService* _tmp26_;
	gulong _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	GQuark _tmp31_;
	GError* _inner_error0_;
};

struct _ProtonPlusCliHandlerHandleInstallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gchar** args;
	gint args_length1;
	gint result;
	ProtonPlusModelsLauncher* launcher;
	const gchar* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	ProtonPlusModelsLauncher* _tmp2_;
	ProtonPlusModelsTool* runner;
	ProtonPlusModelsLauncher* _tmp3_;
	const gchar* _tmp4_;
	ProtonPlusModelsTool* _tmp5_;
	ProtonPlusModelsTool* _tmp6_;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	ProtonPlusModelsTool* _tmp7_;
	ProtonPlusModelsToolsProviderTool* _tmp8_;
	ProtonPlusModelsToolsProviderTool* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gboolean use_latest;
	gint _tmp12_;
	ProtonPlusModelsToolsProviderTool* _tmp13_;
	ProtonPlusModelsToolsProviderTool* _tmp14_;
};

struct _ProtonPlusCliHandlerHandleUninstallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gchar** args;
	gint args_length1;
	gint result;
	ProtonPlusModelsLauncher* launcher;
	const gchar* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	ProtonPlusModelsLauncher* _tmp2_;
	const gchar* _tmp3_;
	ProtonPlusModelsLauncher* _tmp4_;
	ProtonPlusModelsTool* runner;
	ProtonPlusModelsLauncher* _tmp5_;
	const gchar* _tmp6_;
	ProtonPlusModelsTool* _tmp7_;
	ProtonPlusModelsTool* _tmp8_;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	ProtonPlusModelsTool* _tmp9_;
	ProtonPlusModelsToolsProviderTool* _tmp10_;
	ProtonPlusModelsToolsProviderTool* _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp13_;
	gboolean uninstall_all;
	gint _tmp14_;
	ProtonPlusModelsToolsProviderTool* _tmp15_;
	ProtonPlusModelsToolsProviderTool* _tmp16_;
};

struct _ProtonPlusCliHandlerHandleUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gchar** args;
	gint args_length1;
	gint result;
	const gchar* _tmp0_;
	ProtonPlusModelsLauncher* launcher;
	const gchar* _tmp1_;
	ProtonPlusModelsLauncher* _tmp2_;
	ProtonPlusModelsLauncher* _tmp3_;
	ProtonPlusModelsTool* runner;
	ProtonPlusModelsLauncher* _tmp4_;
	const gchar* _tmp5_;
	ProtonPlusModelsTool* _tmp6_;
	ProtonPlusModelsTool* _tmp7_;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	ProtonPlusModelsTool* _tmp8_;
	ProtonPlusModelsToolsProviderTool* _tmp9_;
	ProtonPlusModelsToolsProviderTool* _tmp10_;
	ProtonPlusModelsToolsProviderTool* _tmp11_;
	ProtonPlusModelsLauncher* _tmp12_;
};

struct _ProtonPlusCliHandlerInstallLatestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	gint result;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsReleaseCatalog* _tmp0_;
	ProtonPlusModelsReleaseCatalog* _tmp1_;
	ProtonPlusModelsReleaseCatalog* _tmp2_;
	ProtonPlusModelsReleaseCatalog* _tmp3_;
	ProtonPlusModelsReleaseLookupResult* _result_;
	ProtonPlusModelsReleaseCatalog* _tmp4_;
	ProtonPlusModelsReleaseLookupResult* _tmp5_;
	ProtonPlusModelsReleaseLookupResult* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	ProtonPlusCLIOutput* _tmp9_;
	ProtonPlusModelsReleaseLookupResult* _tmp10_;
	ProtonPlusReturnCode _tmp11_;
	ProtonPlusReturnCode _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	ProtonPlusModelsReleaseLookupResult* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	ProtonPlusCLIOutput* _tmp18_;
	ProtonPlusCLIOutput* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	ProtonPlusServicesInstallJob* job;
	ProtonPlusModelsReleaseLookupResult* _tmp22_;
	ProtonPlusModelsRelease* _tmp23_;
	ProtonPlusModelsRelease* _tmp24_;
	ProtonPlusServicesInstallJob* _tmp25_;
	ProtonPlusServicesInstallJob* _tmp26_;
	ProtonPlusReturnCode code;
	ProtonPlusServicesInstallJob* _tmp27_;
	ProtonPlusCLIOutput* _tmp28_;
	gboolean success;
	ProtonPlusCLIOutput* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	ProtonPlusCLIOutput* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gint _tmp35_;
};

struct _ProtonPlusCliHandlerInstallInteractiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	gint result;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsReleaseCatalog* _tmp0_;
	ProtonPlusModelsReleaseCatalog* _tmp1_;
	ProtonPlusModelsReleaseCatalog* _tmp2_;
	ProtonPlusModelsReleaseCatalog* _tmp3_;
	ProtonPlusReturnCode code;
	gboolean _tmp4_;
	ProtonPlusModelsReleaseCatalog* _tmp5_;
	GeeLinkedList* _tmp6_;
	GeeLinkedList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	ProtonPlusCLIOutput* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gint i;
	gboolean _tmp13_;
	gint _tmp14_;
	ProtonPlusModelsReleaseCatalog* _tmp15_;
	GeeLinkedList* _tmp16_;
	GeeLinkedList* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	ProtonPlusModelsRelease* release;
	ProtonPlusModelsReleaseCatalog* _tmp20_;
	GeeLinkedList* _tmp21_;
	GeeLinkedList* _tmp22_;
	gpointer _tmp23_;
	ProtonPlusModelsRelease* _tmp24_;
	ProtonPlusModelsRelease* _tmp25_;
	ProtonPlusCLIOutput* _tmp26_;
	ProtonPlusModelsRelease* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	ProtonPlusModelsRelease* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	gint index;
	ProtonPlusModelsReleaseCatalog* _tmp33_;
	GeeLinkedList* _tmp34_;
	GeeLinkedList* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	ProtonPlusModelsRelease* selected;
	ProtonPlusModelsReleaseCatalog* _tmp38_;
	GeeLinkedList* _tmp39_;
	GeeLinkedList* _tmp40_;
	gpointer _tmp41_;
	ProtonPlusModelsRelease* _tmp42_;
	ProtonPlusModelsRelease* _tmp43_;
	ProtonPlusCLIOutput* _tmp44_;
	ProtonPlusModelsRelease* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	ProtonPlusServicesInstallJob* job;
	ProtonPlusModelsRelease* _tmp48_;
	ProtonPlusServicesInstallJob* _tmp49_;
	ProtonPlusServicesInstallJob* _tmp50_;
	ProtonPlusCLIOutput* _tmp51_;
	gboolean success;
	ProtonPlusCLIOutput* _tmp52_;
	ProtonPlusModelsRelease* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	ProtonPlusCLIOutput* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	gint _tmp59_;
};

struct _ProtonPlusCliHandlerUninstallInteractiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* runner;
	gint result;
	GeeList* installed;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	ProtonPlusCLIOutput* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	ProtonPlusCLIOutput* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gint i;
	gboolean _tmp10_;
	gint _tmp11_;
	GeeList* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	ProtonPlusCLIOutput* _tmp15_;
	GeeList* _tmp16_;
	gpointer _tmp17_;
	ProtonPlusModelsInstalledToolEntry* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gint index;
	GeeList* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	GeeList* _tmp24_;
	gpointer _tmp25_;
	ProtonPlusModelsInstalledToolEntry* _tmp26_;
	gint _tmp27_;
};

struct _ProtonPlusCliHandlerUninstallRunnerAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* runner;
	gint result;
	GeeList* installed;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	ProtonPlusCLIOutput* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	ProtonPlusCLIOutput* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gboolean failed;
	GeeList* _entry_list;
	GeeList* _tmp10_;
	gint _entry_size;
	GeeList* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint _entry_index;
	gint _tmp14_;
	gint _tmp15_;
	ProtonPlusModelsInstalledToolEntry* entry;
	GeeList* _tmp16_;
	gpointer _tmp17_;
	gint code;
	ProtonPlusModelsInstalledToolEntry* _tmp18_;
	gint _tmp19_;
};

struct _ProtonPlusCliHandlerUninstallLauncherAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsLauncher* launcher;
	gint result;
	ProtonPlusCLIOutput* _tmp0_;
	const gchar* _tmp1_;
	gboolean failed;
	ProtonPlusModelsGroup** _tmp2_;
	gint _tmp2__length1;
	ProtonPlusModelsGroup** group_collection;
	gint group_collection_length1;
	gint _group_collection_size_;
	gint group_it;
	ProtonPlusModelsGroup* _tmp3_;
	ProtonPlusModelsGroup* group;
	GeeLinkedList* _runner_list;
	ProtonPlusModelsGroup* _tmp4_;
	GeeLinkedList* _tmp5_;
	GeeLinkedList* _tmp6_;
	gint _runner_size;
	GeeLinkedList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gint _runner_index;
	gint _tmp10_;
	gint _tmp11_;
	ProtonPlusModelsTool* runner;
	GeeLinkedList* _tmp12_;
	gpointer _tmp13_;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	ProtonPlusModelsTool* _tmp14_;
	ProtonPlusModelsToolsProviderTool* _tmp15_;
	ProtonPlusModelsToolsProviderTool* _tmp16_;
	GeeList* installed;
	ProtonPlusModelsToolsProviderTool* _tmp17_;
	GeeList* _tmp18_;
	GeeList* _entry_list;
	GeeList* _tmp19_;
	gint _entry_size;
	GeeList* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	gint _entry_index;
	gint _tmp23_;
	gint _tmp24_;
	ProtonPlusModelsInstalledToolEntry* entry;
	GeeList* _tmp25_;
	gpointer _tmp26_;
	gint code;
	ProtonPlusModelsToolsProviderTool* _tmp27_;
	ProtonPlusModelsInstalledToolEntry* _tmp28_;
	gint _tmp29_;
};

struct _ProtonPlusCliHandlerUninstallSingleReleaseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* runner;
	ProtonPlusModelsInstalledToolEntry* entry;
	gint result;
	ProtonPlusServicesInstallJob* job;
	ProtonPlusServicesInstallJob* _tmp0_;
	ProtonPlusCLIOutput* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ProtonPlusReturnCode code;
	ProtonPlusServicesInstallJob* _tmp4_;
	gboolean success;
	ProtonPlusCLIOutput* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	ProtonPlusCLIOutput* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gint _tmp11_;
};

struct _ProtonPlusCliHandlerUpdateAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gint result;
	ProtonPlusCLIOutput* _tmp0_;
	GeeLinkedList* latest_runners;
	GeeLinkedList* _tmp1_;
	GeeLinkedList* _tmp2_;
};

struct _ProtonPlusCliHandlerUpdateLauncherData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsLauncher* launcher;
	gint result;
	ProtonPlusCLIOutput* _tmp0_;
	const gchar* _tmp1_;
	GeeLinkedList* scoped;
	GeeLinkedList* _tmp2_;
	GeeLinkedList* latest_runners;
	GeeLinkedList* _tmp3_;
};

struct _ProtonPlusCliHandlerUpdateRunnerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* runner;
	gint result;
	ProtonPlusReturnCode code;
	ProtonPlusCLIOutput* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	ProtonPlusCLIOutput* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	ProtonPlusCLIOutput* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
};

struct _ProtonPlusCliHandlerUpdateRunnerBatchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	GeeLinkedList* runners;
	gint result;
	gint _tmp0_;
	gint _tmp1_;
	ProtonPlusCLIOutput* _tmp2_;
	gboolean failed;
	GeeLinkedList* _runner_list;
	gint _runner_size;
	GeeLinkedList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _runner_index;
	gint _tmp6_;
	gint _tmp7_;
	ProtonPlusModelsToolsProviderTool* runner;
	GeeLinkedList* _tmp8_;
	gpointer _tmp9_;
	ProtonPlusReturnCode code;
	ProtonPlusModelsToolsProviderTool* _tmp10_;
	ProtonPlusCLIOutput* _tmp11_;
	ProtonPlusModelsToolsProviderTool* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	ProtonPlusCLIOutput* _tmp15_;
	ProtonPlusModelsToolsProviderTool* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	ProtonPlusCLIOutput* _tmp19_;
	ProtonPlusModelsToolsProviderTool* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gint _tmp25_;
};

struct _ProtonPlusCliHandlerUpdateRunnerWithProgressData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* runner;
	ProtonPlusReturnCode result;
	ProtonPlusCLIOutput* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	ProtonPlusCLIOutput* _tmp5_;
	ProtonPlusReturnCode code;
	ProtonPlusServicesInstallationService* _tmp6_;
	ProtonPlusServicesInstallationService* _tmp7_;
	ProtonPlusCLIOutput* _tmp8_;
};

struct _ProtonPlusCliHandlerLoadLaunchersData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	gboolean result;
	GeeLinkedList* _tmp0_;
	GeeLinkedList* _tmp1_;
	GeeLinkedList* _tmp2_;
	gboolean success;
	GeeLinkedList* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GeeLinkedList* _tmp6_;
	ProtonPlusCLIOutput* _tmp7_;
};

struct _ProtonPlusCliHandlerLoadRunnerReleasesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusCLIHandler* self;
	ProtonPlusModelsToolsProviderTool* provider_tool;
	ProtonPlusReturnCode result;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsReleaseCatalog* _tmp0_;
	ProtonPlusModelsReleaseCatalog* _tmp1_;
	ProtonPlusModelsReleaseCatalog* _tmp2_;
	ProtonPlusModelsReleaseCatalog* _tmp3_;
	ProtonPlusModelsReleaseCatalogResult* _result_;
	ProtonPlusModelsReleaseCatalog* _tmp4_;
	ProtonPlusModelsReleaseCatalogResult* _tmp5_;
	ProtonPlusModelsReleaseCatalogResult* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	ProtonPlusCLIOutput* _tmp9_;
	ProtonPlusModelsReleaseCatalogResult* _tmp10_;
	ProtonPlusReturnCode _tmp11_;
	ProtonPlusReturnCode _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	ProtonPlusModelsReleaseCatalogResult* _tmp15_;
	GeeLinkedList* _tmp16_;
	GeeLinkedList* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	ProtonPlusCLIOutput* _tmp20_;
	ProtonPlusModelsReleaseCatalogResult* _tmp21_;
	ProtonPlusReturnCode _tmp22_;
	ProtonPlusReturnCode _tmp23_;
};

struct _ProtonPlusCLIParamSpecHandler {
	GParamSpec parent_instance;
};

static gpointer proton_plus_cli_terminal_cli_output_sink_parent_class = NULL;
static ProtonPlusCLICliOutputSinkIface * proton_plus_cli_terminal_cli_output_sink_proton_plus_cli_cli_output_sink_parent_iface = NULL;
static gint ProtonPlusCLIRecordingCliOutputSink_private_offset;
static gpointer proton_plus_cli_recording_cli_output_sink_parent_class = NULL;
static ProtonPlusCLICliOutputSinkIface * proton_plus_cli_recording_cli_output_sink_proton_plus_cli_cli_output_sink_parent_iface = NULL;
static gint ProtonPlusCLIOutput_private_offset;
static gpointer proton_plus_cli_output_parent_class = NULL;
static gint ProtonPlusCLIHandler_private_offset;
static gpointer proton_plus_cli_handler_parent_class = NULL;

static GType proton_plus_cli_cli_output_sink_get_type_once (void);
static void proton_plus_cli_terminal_cli_output_sink_real_write_stdout (ProtonPlusCLICliOutputSink* base,
                                                                 const gchar* text);
static void proton_plus_cli_terminal_cli_output_sink_real_write_stderr (ProtonPlusCLICliOutputSink* base,
                                                                 const gchar* text);
static void proton_plus_cli_terminal_cli_output_sink_real_flush_stdout (ProtonPlusCLICliOutputSink* base);
static GType proton_plus_cli_terminal_cli_output_sink_get_type_once (void);
static void proton_plus_cli_recording_cli_output_sink_real_write_stdout (ProtonPlusCLICliOutputSink* base,
                                                                  const gchar* text);
static void proton_plus_cli_recording_cli_output_sink_set_stdout_text (ProtonPlusCLIRecordingCliOutputSink* self,
                                                                const gchar* value);
static void proton_plus_cli_recording_cli_output_sink_real_write_stderr (ProtonPlusCLICliOutputSink* base,
                                                                  const gchar* text);
static void proton_plus_cli_recording_cli_output_sink_set_stderr_text (ProtonPlusCLIRecordingCliOutputSink* self,
                                                                const gchar* value);
static void proton_plus_cli_recording_cli_output_sink_real_flush_stdout (ProtonPlusCLICliOutputSink* base);
static void proton_plus_cli_recording_cli_output_sink_finalize (GObject * obj);
static GType proton_plus_cli_recording_cli_output_sink_get_type_once (void);
static void _vala_proton_plus_cli_recording_cli_output_sink_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_proton_plus_cli_recording_cli_output_sink_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec);
VALA_EXTERN gpointer proton_plus_cli_output_ref (gpointer instance);
VALA_EXTERN void proton_plus_cli_output_unref (gpointer instance);
VALA_EXTERN GParamSpec* proton_plus_cli_param_spec_output (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void proton_plus_cli_value_set_output (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void proton_plus_cli_value_take_output (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer proton_plus_cli_value_get_output (const GValue* value);
VALA_EXTERN GType proton_plus_cli_output_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusCLIOutput* proton_plus_cli_output_new (ProtonPlusCLICliOutputSink* sink);
VALA_EXTERN ProtonPlusCLIOutput* proton_plus_cli_output_construct (GType object_type,
                                                       ProtonPlusCLICliOutputSink* sink);
VALA_EXTERN void proton_plus_cli_output_info (ProtonPlusCLIOutput* self,
                                  const gchar* format,
                                  ...);
VALA_EXTERN void proton_plus_cli_output_success (ProtonPlusCLIOutput* self,
                                     const gchar* format,
                                     ...);
VALA_EXTERN void proton_plus_cli_output_error (ProtonPlusCLIOutput* self,
                                   const gchar* format,
                                   ...);
VALA_EXTERN void proton_plus_cli_output_warning (ProtonPlusCLIOutput* self,
                                     const gchar* format,
                                     ...);
VALA_EXTERN void proton_plus_cli_output_header (ProtonPlusCLIOutput* self,
                                    const gchar* format,
                                    ...);
VALA_EXTERN void proton_plus_cli_output_flush_stdout (ProtonPlusCLIOutput* self);
static void proton_plus_cli_output_finalize (ProtonPlusCLIOutput * obj);
static GType proton_plus_cli_output_get_type_once (void);
static void proton_plus_cli_handler_set_output_sink (ProtonPlusCLIHandler* self,
                                              ProtonPlusCLICliOutputSink* value);
static void proton_plus_cli_handler_run_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_run_co (ProtonPlusCliHandlerRunData* _data_);
static void proton_plus_cli_handler_print_usage (ProtonPlusCLIHandler* self);
static void proton_plus_cli_handler_on_progress_updated (ProtonPlusCLIHandler* self,
                                                  ProtonPlusServicesInstallJob* job);
static void _proton_plus_cli_handler_on_progress_updated_proton_plus_utils_download_manager_progress_updated (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                       ProtonPlusServicesInstallJob* job,
                                                                                                       gpointer self);
static void ___lambda28_ (ProtonPlusCLIHandler* self,
                   ProtonPlusServicesInstallJob* job,
                   const gchar* message);
static void ____lambda28__proton_plus_services_installation_service_steam_restart_recording_failed (ProtonPlusServicesInstallationService* _sender,
                                                                                             ProtonPlusServicesInstallJob* job,
                                                                                             const gchar* message,
                                                                                             gpointer self);
static void proton_plus_cli_handler_load_launchers (ProtonPlusCLIHandler* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gboolean proton_plus_cli_handler_load_launchers_finish (ProtonPlusCLIHandler* self,
                                                        GAsyncResult* _res_);
static void proton_plus_cli_handler_run_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void proton_plus_cli_handler_disconnect_runtime_signals (ProtonPlusCLIHandler* self);
static gint proton_plus_cli_handler_handle_list (ProtonPlusCLIHandler* self,
                                          gchar** args,
                                          gint args_length1);
static void proton_plus_cli_handler_handle_install (ProtonPlusCLIHandler* self,
                                             gchar** args,
                                             gint args_length1,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gint proton_plus_cli_handler_handle_install_finish (ProtonPlusCLIHandler* self,
                                                    GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_uninstall (ProtonPlusCLIHandler* self,
                                               gchar** args,
                                               gint args_length1,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static gint proton_plus_cli_handler_handle_uninstall_finish (ProtonPlusCLIHandler* self,
                                                      GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_update (ProtonPlusCLIHandler* self,
                                            gchar** args,
                                            gint args_length1,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static gint proton_plus_cli_handler_handle_update_finish (ProtonPlusCLIHandler* self,
                                                   GAsyncResult* _res_);
static ProtonPlusModelsLauncher* proton_plus_cli_handler_find_launcher (ProtonPlusCLIHandler* self,
                                                                 const gchar* launcher_id);
static void proton_plus_cli_handler_handle_install_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_handle_install_co (ProtonPlusCliHandlerHandleInstallData* _data_);
static gboolean proton_plus_cli_handler_validate_args (ProtonPlusCLIHandler* self,
                                                gchar** args,
                                                gint args_length1,
                                                gint min_required,
                                                const gchar* usage);
static ProtonPlusModelsTool* proton_plus_cli_handler_find_runner (ProtonPlusCLIHandler* self,
                                                           ProtonPlusModelsLauncher* launcher,
                                                           const gchar* runner_id);
static ProtonPlusModelsToolsProviderTool* proton_plus_cli_handler_get_provider_tool (ProtonPlusCLIHandler* self,
                                                                              ProtonPlusModelsTool* runner,
                                                                              const gchar* operation);
static void proton_plus_cli_handler_install_latest (ProtonPlusCLIHandler* self,
                                             ProtonPlusModelsToolsProviderTool* provider_tool,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gint proton_plus_cli_handler_install_latest_finish (ProtonPlusCLIHandler* self,
                                                    GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_install_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void proton_plus_cli_handler_install_interactive (ProtonPlusCLIHandler* self,
                                                  ProtonPlusModelsToolsProviderTool* provider_tool,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static gint proton_plus_cli_handler_install_interactive_finish (ProtonPlusCLIHandler* self,
                                                         GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_uninstall_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_handle_uninstall_co (ProtonPlusCliHandlerHandleUninstallData* _data_);
static void proton_plus_cli_handler_uninstall_launcher_all (ProtonPlusCLIHandler* self,
                                                     ProtonPlusModelsLauncher* launcher,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static gint proton_plus_cli_handler_uninstall_launcher_all_finish (ProtonPlusCLIHandler* self,
                                                            GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_uninstall_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void proton_plus_cli_handler_uninstall_runner_all (ProtonPlusCLIHandler* self,
                                                   ProtonPlusModelsToolsProviderTool* runner,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static gint proton_plus_cli_handler_uninstall_runner_all_finish (ProtonPlusCLIHandler* self,
                                                          GAsyncResult* _res_);
static void proton_plus_cli_handler_uninstall_interactive (ProtonPlusCLIHandler* self,
                                                    ProtonPlusModelsToolsProviderTool* runner,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gint proton_plus_cli_handler_uninstall_interactive_finish (ProtonPlusCLIHandler* self,
                                                           GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_update_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_handle_update_co (ProtonPlusCliHandlerHandleUpdateData* _data_);
static void proton_plus_cli_handler_update_all (ProtonPlusCLIHandler* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gint proton_plus_cli_handler_update_all_finish (ProtonPlusCLIHandler* self,
                                                GAsyncResult* _res_);
static void proton_plus_cli_handler_handle_update_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void proton_plus_cli_handler_update_runner (ProtonPlusCLIHandler* self,
                                            ProtonPlusModelsToolsProviderTool* runner,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static gint proton_plus_cli_handler_update_runner_finish (ProtonPlusCLIHandler* self,
                                                   GAsyncResult* _res_);
static void proton_plus_cli_handler_update_launcher (ProtonPlusCLIHandler* self,
                                              ProtonPlusModelsLauncher* launcher,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gint proton_plus_cli_handler_update_launcher_finish (ProtonPlusCLIHandler* self,
                                                     GAsyncResult* _res_);
static void proton_plus_cli_handler_install_latest_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_install_latest_co (ProtonPlusCliHandlerInstallLatestData* _data_);
static void proton_plus_cli_handler_install_latest_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void proton_plus_cli_handler_install_interactive_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_install_interactive_co (ProtonPlusCliHandlerInstallInteractiveData* _data_);
static void proton_plus_cli_handler_load_runner_releases (ProtonPlusCLIHandler* self,
                                                   ProtonPlusModelsToolsProviderTool* provider_tool,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static ProtonPlusReturnCode proton_plus_cli_handler_load_runner_releases_finish (ProtonPlusCLIHandler* self,
                                                                          GAsyncResult* _res_);
static void proton_plus_cli_handler_install_interactive_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static gint proton_plus_cli_handler_read_user_selection (ProtonPlusCLIHandler* self,
                                                  const gchar* prompt,
                                                  gint max);
static void proton_plus_cli_handler_uninstall_interactive_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_uninstall_interactive_co (ProtonPlusCliHandlerUninstallInteractiveData* _data_);
static GeeList* proton_plus_cli_handler_get_installed_entries (ProtonPlusCLIHandler* self,
                                                        ProtonPlusModelsToolsProviderTool* runner);
static void proton_plus_cli_handler_uninstall_single_release (ProtonPlusCLIHandler* self,
                                                       ProtonPlusModelsToolsProviderTool* runner,
                                                       ProtonPlusModelsInstalledToolEntry* entry,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_);
static gint proton_plus_cli_handler_uninstall_single_release_finish (ProtonPlusCLIHandler* self,
                                                              GAsyncResult* _res_);
static void proton_plus_cli_handler_uninstall_interactive_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void proton_plus_cli_handler_uninstall_runner_all_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_uninstall_runner_all_co (ProtonPlusCliHandlerUninstallRunnerAllData* _data_);
static void proton_plus_cli_handler_uninstall_runner_all_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void proton_plus_cli_handler_uninstall_launcher_all_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_uninstall_launcher_all_co (ProtonPlusCliHandlerUninstallLauncherAllData* _data_);
static void proton_plus_cli_handler_uninstall_launcher_all_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void proton_plus_cli_handler_uninstall_single_release_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_uninstall_single_release_co (ProtonPlusCliHandlerUninstallSingleReleaseData* _data_);
static ProtonPlusServicesInstallJob* proton_plus_cli_handler_create_job (ProtonPlusCLIHandler* self,
                                                                  ProtonPlusModelsToolsProviderTool* runner,
                                                                  ProtonPlusModelsInstalledToolEntry* entry);
static void proton_plus_cli_handler_uninstall_single_release_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_);
static void proton_plus_cli_handler_update_all_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_update_all_co (ProtonPlusCliHandlerUpdateAllData* _data_);
static GeeLinkedList* proton_plus_cli_handler_collect_latest_runners (ProtonPlusCLIHandler* self,
                                                               GeeLinkedList* scope);
static void proton_plus_cli_handler_update_runner_batch (ProtonPlusCLIHandler* self,
                                                  GeeLinkedList* runners,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static gint proton_plus_cli_handler_update_runner_batch_finish (ProtonPlusCLIHandler* self,
                                                         GAsyncResult* _res_);
static void proton_plus_cli_handler_update_all_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void proton_plus_cli_handler_update_launcher_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_update_launcher_co (ProtonPlusCliHandlerUpdateLauncherData* _data_);
static void proton_plus_cli_handler_update_launcher_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void proton_plus_cli_handler_update_runner_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_update_runner_co (ProtonPlusCliHandlerUpdateRunnerData* _data_);
static void proton_plus_cli_handler_update_runner_with_progress (ProtonPlusCLIHandler* self,
                                                          ProtonPlusModelsToolsProviderTool* runner,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static ProtonPlusReturnCode proton_plus_cli_handler_update_runner_with_progress_finish (ProtonPlusCLIHandler* self,
                                                                                 GAsyncResult* _res_);
static void proton_plus_cli_handler_update_runner_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void proton_plus_cli_handler_update_runner_batch_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_update_runner_batch_co (ProtonPlusCliHandlerUpdateRunnerBatchData* _data_);
static void proton_plus_cli_handler_update_runner_batch_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void proton_plus_cli_handler_update_runner_with_progress_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_update_runner_with_progress_co (ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_);
static void proton_plus_cli_handler_update_runner_with_progress_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void proton_plus_cli_handler_load_launchers_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_load_launchers_co (ProtonPlusCliHandlerLoadLaunchersData* _data_);
static void proton_plus_cli_handler_load_launchers_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void proton_plus_cli_handler_load_runner_releases_data_free (gpointer _data);
static gboolean proton_plus_cli_handler_load_runner_releases_co (ProtonPlusCliHandlerLoadRunnerReleasesData* _data_);
static void proton_plus_cli_handler_load_runner_releases_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void proton_plus_cli_handler_print_available_launchers (ProtonPlusCLIHandler* self);
static void proton_plus_cli_handler_print_available_runners (ProtonPlusCLIHandler* self,
                                                      ProtonPlusModelsLauncher* launcher);
static gchar* proton_plus_cli_handler_get_legacy_launcher_id (ProtonPlusModelsLauncher* launcher);
static gchar* proton_plus_cli_handler_get_legacy_runner_id (ProtonPlusModelsTool* runner);
static ProtonPlusServicesInstallJob* proton_plus_cli_handler_real_create_install_job (ProtonPlusCLIHandler* self,
                                                                               ProtonPlusModelsRelease* release,
                                                                               ProtonPlusModelsToolsProviderTool* provider_tool,
                                                                               ProtonPlusServicesInstallJobMode mode,
                                                                               const gchar* installation_location);
static gchar* proton_plus_cli_handler_format_time (ProtonPlusCLIHandler* self,
                                            gdouble seconds);
static void proton_plus_cli_handler_finalize (ProtonPlusCLIHandler * obj);
static GType proton_plus_cli_handler_get_type_once (void);

void
proton_plus_cli_cli_output_sink_write_stdout (ProtonPlusCLICliOutputSink* self,
                                              const gchar* text)
{
	ProtonPlusCLICliOutputSinkIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PROTON_PLUS_CLI_CLI_OUTPUT_SINK_GET_INTERFACE (self);
	if (_iface_->write_stdout) {
		_iface_->write_stdout (self, text);
	}
}

void
proton_plus_cli_cli_output_sink_write_stderr (ProtonPlusCLICliOutputSink* self,
                                              const gchar* text)
{
	ProtonPlusCLICliOutputSinkIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PROTON_PLUS_CLI_CLI_OUTPUT_SINK_GET_INTERFACE (self);
	if (_iface_->write_stderr) {
		_iface_->write_stderr (self, text);
	}
}

void
proton_plus_cli_cli_output_sink_flush_stdout (ProtonPlusCLICliOutputSink* self)
{
	ProtonPlusCLICliOutputSinkIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PROTON_PLUS_CLI_CLI_OUTPUT_SINK_GET_INTERFACE (self);
	if (_iface_->flush_stdout) {
		_iface_->flush_stdout (self);
	}
}

static void
proton_plus_cli_cli_output_sink_default_init (ProtonPlusCLICliOutputSinkIface * iface,
                                              gpointer iface_data)
{
}

static GType
proton_plus_cli_cli_output_sink_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusCLICliOutputSinkIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_cli_cli_output_sink_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_cli_cli_output_sink_type_id;
	proton_plus_cli_cli_output_sink_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusCLICliOutputSink", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_cli_cli_output_sink_type_id, G_TYPE_OBJECT);
	return proton_plus_cli_cli_output_sink_type_id;
}

GType
proton_plus_cli_cli_output_sink_get_type (void)
{
	static volatile gsize proton_plus_cli_cli_output_sink_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_cli_cli_output_sink_type_id__once)) {
		GType proton_plus_cli_cli_output_sink_type_id;
		proton_plus_cli_cli_output_sink_type_id = proton_plus_cli_cli_output_sink_get_type_once ();
		g_once_init_leave (&proton_plus_cli_cli_output_sink_type_id__once, proton_plus_cli_cli_output_sink_type_id);
	}
	return proton_plus_cli_cli_output_sink_type_id__once;
}

static void
proton_plus_cli_terminal_cli_output_sink_real_write_stdout (ProtonPlusCLICliOutputSink* base,
                                                            const gchar* text)
{
	ProtonPlusCLITerminalCliOutputSink * self;
	self = (ProtonPlusCLITerminalCliOutputSink*) base;
	g_return_if_fail (text != NULL);
	g_print ("%s", text);
}

static void
proton_plus_cli_terminal_cli_output_sink_real_write_stderr (ProtonPlusCLICliOutputSink* base,
                                                            const gchar* text)
{
	ProtonPlusCLITerminalCliOutputSink * self;
	self = (ProtonPlusCLITerminalCliOutputSink*) base;
	g_return_if_fail (text != NULL);
	g_printerr ("%s", text);
}

static void
proton_plus_cli_terminal_cli_output_sink_real_flush_stdout (ProtonPlusCLICliOutputSink* base)
{
	ProtonPlusCLITerminalCliOutputSink * self;
	FILE* _tmp0_;
	self = (ProtonPlusCLITerminalCliOutputSink*) base;
	_tmp0_ = stdout;
	fflush (_tmp0_);
}

ProtonPlusCLITerminalCliOutputSink*
proton_plus_cli_terminal_cli_output_sink_construct (GType object_type)
{
	ProtonPlusCLITerminalCliOutputSink * self = NULL;
	self = (ProtonPlusCLITerminalCliOutputSink*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusCLITerminalCliOutputSink*
proton_plus_cli_terminal_cli_output_sink_new (void)
{
	return proton_plus_cli_terminal_cli_output_sink_construct (PROTON_PLUS_CLI_TYPE_TERMINAL_CLI_OUTPUT_SINK);
}

static void
proton_plus_cli_terminal_cli_output_sink_class_init (ProtonPlusCLITerminalCliOutputSinkClass * klass,
                                                     gpointer klass_data)
{
	proton_plus_cli_terminal_cli_output_sink_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_cli_terminal_cli_output_sink_proton_plus_cli_cli_output_sink_interface_init (ProtonPlusCLICliOutputSinkIface * iface,
                                                                                         gpointer iface_data)
{
	proton_plus_cli_terminal_cli_output_sink_proton_plus_cli_cli_output_sink_parent_iface = g_type_interface_peek_parent (iface);
	iface->write_stdout = (void (*) (ProtonPlusCLICliOutputSink*, const gchar*)) proton_plus_cli_terminal_cli_output_sink_real_write_stdout;
	iface->write_stderr = (void (*) (ProtonPlusCLICliOutputSink*, const gchar*)) proton_plus_cli_terminal_cli_output_sink_real_write_stderr;
	iface->flush_stdout = (void (*) (ProtonPlusCLICliOutputSink*)) proton_plus_cli_terminal_cli_output_sink_real_flush_stdout;
}

static void
proton_plus_cli_terminal_cli_output_sink_instance_init (ProtonPlusCLITerminalCliOutputSink * self,
                                                        gpointer klass)
{
}

static GType
proton_plus_cli_terminal_cli_output_sink_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusCLITerminalCliOutputSinkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_cli_terminal_cli_output_sink_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusCLITerminalCliOutputSink), 0, (GInstanceInitFunc) proton_plus_cli_terminal_cli_output_sink_instance_init, NULL };
	static const GInterfaceInfo proton_plus_cli_cli_output_sink_info = { (GInterfaceInitFunc) proton_plus_cli_terminal_cli_output_sink_proton_plus_cli_cli_output_sink_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_cli_terminal_cli_output_sink_type_id;
	proton_plus_cli_terminal_cli_output_sink_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusCLITerminalCliOutputSink", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_cli_terminal_cli_output_sink_type_id, PROTON_PLUS_CLI_TYPE_CLI_OUTPUT_SINK, &proton_plus_cli_cli_output_sink_info);
	return proton_plus_cli_terminal_cli_output_sink_type_id;
}

GType
proton_plus_cli_terminal_cli_output_sink_get_type (void)
{
	static volatile gsize proton_plus_cli_terminal_cli_output_sink_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_cli_terminal_cli_output_sink_type_id__once)) {
		GType proton_plus_cli_terminal_cli_output_sink_type_id;
		proton_plus_cli_terminal_cli_output_sink_type_id = proton_plus_cli_terminal_cli_output_sink_get_type_once ();
		g_once_init_leave (&proton_plus_cli_terminal_cli_output_sink_type_id__once, proton_plus_cli_terminal_cli_output_sink_type_id);
	}
	return proton_plus_cli_terminal_cli_output_sink_type_id__once;
}

static inline gpointer
proton_plus_cli_recording_cli_output_sink_get_instance_private (ProtonPlusCLIRecordingCliOutputSink* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusCLIRecordingCliOutputSink_private_offset);
}

static void
proton_plus_cli_recording_cli_output_sink_real_write_stdout (ProtonPlusCLICliOutputSink* base,
                                                             const gchar* text)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = (ProtonPlusCLIRecordingCliOutputSink*) base;
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->_stdout_text;
	_tmp1_ = g_strconcat (_tmp0_, text, NULL);
	_tmp2_ = _tmp1_;
	proton_plus_cli_recording_cli_output_sink_set_stdout_text (self, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
proton_plus_cli_recording_cli_output_sink_real_write_stderr (ProtonPlusCLICliOutputSink* base,
                                                             const gchar* text)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = (ProtonPlusCLIRecordingCliOutputSink*) base;
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->_stderr_text;
	_tmp1_ = g_strconcat (_tmp0_, text, NULL);
	_tmp2_ = _tmp1_;
	proton_plus_cli_recording_cli_output_sink_set_stderr_text (self, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
proton_plus_cli_recording_cli_output_sink_real_flush_stdout (ProtonPlusCLICliOutputSink* base)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	self = (ProtonPlusCLIRecordingCliOutputSink*) base;
}

ProtonPlusCLIRecordingCliOutputSink*
proton_plus_cli_recording_cli_output_sink_construct (GType object_type)
{
	ProtonPlusCLIRecordingCliOutputSink * self = NULL;
	self = (ProtonPlusCLIRecordingCliOutputSink*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusCLIRecordingCliOutputSink*
proton_plus_cli_recording_cli_output_sink_new (void)
{
	return proton_plus_cli_recording_cli_output_sink_construct (PROTON_PLUS_CLI_TYPE_RECORDING_CLI_OUTPUT_SINK);
}

const gchar*
proton_plus_cli_recording_cli_output_sink_get_stdout_text (ProtonPlusCLIRecordingCliOutputSink* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stdout_text;
	result = _tmp0_;
	return result;
}

static void
proton_plus_cli_recording_cli_output_sink_set_stdout_text (ProtonPlusCLIRecordingCliOutputSink* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_cli_recording_cli_output_sink_get_stdout_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_stdout_text);
		self->priv->_stdout_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_cli_recording_cli_output_sink_properties[PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY]);
	}
}

const gchar*
proton_plus_cli_recording_cli_output_sink_get_stderr_text (ProtonPlusCLIRecordingCliOutputSink* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stderr_text;
	result = _tmp0_;
	return result;
}

static void
proton_plus_cli_recording_cli_output_sink_set_stderr_text (ProtonPlusCLIRecordingCliOutputSink* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_cli_recording_cli_output_sink_get_stderr_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_stderr_text);
		self->priv->_stderr_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_cli_recording_cli_output_sink_properties[PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY]);
	}
}

static void
proton_plus_cli_recording_cli_output_sink_class_init (ProtonPlusCLIRecordingCliOutputSinkClass * klass,
                                                      gpointer klass_data)
{
	proton_plus_cli_recording_cli_output_sink_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusCLIRecordingCliOutputSink_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_cli_recording_cli_output_sink_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_cli_recording_cli_output_sink_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_cli_recording_cli_output_sink_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY, proton_plus_cli_recording_cli_output_sink_properties[PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY] = g_param_spec_string ("stdout-text", "stdout-text", "stdout-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY, proton_plus_cli_recording_cli_output_sink_properties[PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY] = g_param_spec_string ("stderr-text", "stderr-text", "stderr-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_cli_recording_cli_output_sink_proton_plus_cli_cli_output_sink_interface_init (ProtonPlusCLICliOutputSinkIface * iface,
                                                                                          gpointer iface_data)
{
	proton_plus_cli_recording_cli_output_sink_proton_plus_cli_cli_output_sink_parent_iface = g_type_interface_peek_parent (iface);
	iface->write_stdout = (void (*) (ProtonPlusCLICliOutputSink*, const gchar*)) proton_plus_cli_recording_cli_output_sink_real_write_stdout;
	iface->write_stderr = (void (*) (ProtonPlusCLICliOutputSink*, const gchar*)) proton_plus_cli_recording_cli_output_sink_real_write_stderr;
	iface->flush_stdout = (void (*) (ProtonPlusCLICliOutputSink*)) proton_plus_cli_recording_cli_output_sink_real_flush_stdout;
}

static void
proton_plus_cli_recording_cli_output_sink_instance_init (ProtonPlusCLIRecordingCliOutputSink * self,
                                                         gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = proton_plus_cli_recording_cli_output_sink_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_stdout_text = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_stderr_text = _tmp1_;
}

static void
proton_plus_cli_recording_cli_output_sink_finalize (GObject * obj)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_CLI_TYPE_RECORDING_CLI_OUTPUT_SINK, ProtonPlusCLIRecordingCliOutputSink);
	_g_free0 (self->priv->_stdout_text);
	_g_free0 (self->priv->_stderr_text);
	G_OBJECT_CLASS (proton_plus_cli_recording_cli_output_sink_parent_class)->finalize (obj);
}

static GType
proton_plus_cli_recording_cli_output_sink_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusCLIRecordingCliOutputSinkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_cli_recording_cli_output_sink_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusCLIRecordingCliOutputSink), 0, (GInstanceInitFunc) proton_plus_cli_recording_cli_output_sink_instance_init, NULL };
	static const GInterfaceInfo proton_plus_cli_cli_output_sink_info = { (GInterfaceInitFunc) proton_plus_cli_recording_cli_output_sink_proton_plus_cli_cli_output_sink_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_cli_recording_cli_output_sink_type_id;
	proton_plus_cli_recording_cli_output_sink_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusCLIRecordingCliOutputSink", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_cli_recording_cli_output_sink_type_id, PROTON_PLUS_CLI_TYPE_CLI_OUTPUT_SINK, &proton_plus_cli_cli_output_sink_info);
	ProtonPlusCLIRecordingCliOutputSink_private_offset = g_type_add_instance_private (proton_plus_cli_recording_cli_output_sink_type_id, sizeof (ProtonPlusCLIRecordingCliOutputSinkPrivate));
	return proton_plus_cli_recording_cli_output_sink_type_id;
}

GType
proton_plus_cli_recording_cli_output_sink_get_type (void)
{
	static volatile gsize proton_plus_cli_recording_cli_output_sink_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_cli_recording_cli_output_sink_type_id__once)) {
		GType proton_plus_cli_recording_cli_output_sink_type_id;
		proton_plus_cli_recording_cli_output_sink_type_id = proton_plus_cli_recording_cli_output_sink_get_type_once ();
		g_once_init_leave (&proton_plus_cli_recording_cli_output_sink_type_id__once, proton_plus_cli_recording_cli_output_sink_type_id);
	}
	return proton_plus_cli_recording_cli_output_sink_type_id__once;
}

static void
_vala_proton_plus_cli_recording_cli_output_sink_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_CLI_TYPE_RECORDING_CLI_OUTPUT_SINK, ProtonPlusCLIRecordingCliOutputSink);
	switch (property_id) {
		case PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY:
		g_value_set_string (value, proton_plus_cli_recording_cli_output_sink_get_stdout_text (self));
		break;
		case PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY:
		g_value_set_string (value, proton_plus_cli_recording_cli_output_sink_get_stderr_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_cli_recording_cli_output_sink_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	ProtonPlusCLIRecordingCliOutputSink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_CLI_TYPE_RECORDING_CLI_OUTPUT_SINK, ProtonPlusCLIRecordingCliOutputSink);
	switch (property_id) {
		case PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDOUT_TEXT_PROPERTY:
		proton_plus_cli_recording_cli_output_sink_set_stdout_text (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_CLI_RECORDING_CLI_OUTPUT_SINK_STDERR_TEXT_PROPERTY:
		proton_plus_cli_recording_cli_output_sink_set_stderr_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
proton_plus_cli_output_get_instance_private (ProtonPlusCLIOutput* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusCLIOutput_private_offset);
}

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

ProtonPlusCLIOutput*
proton_plus_cli_output_construct (GType object_type,
                                  ProtonPlusCLICliOutputSink* sink)
{
	ProtonPlusCLIOutput* self = NULL;
	ProtonPlusCLICliOutputSink* _tmp0_;
	g_return_val_if_fail (sink != NULL, NULL);
	self = (ProtonPlusCLIOutput*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (sink);
	_g_object_unref0 (self->priv->sink);
	self->priv->sink = _tmp0_;
	return self;
}

ProtonPlusCLIOutput*
proton_plus_cli_output_new (ProtonPlusCLICliOutputSink* sink)
{
	return proton_plus_cli_output_construct (PROTON_PLUS_CLI_TYPE_OUTPUT, sink);
}

void
proton_plus_cli_output_info (ProtonPlusCLIOutput* self,
                             const gchar* format,
                             ...)
{
	va_list args = {0};
	ProtonPlusCLICliOutputSink* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (format != NULL);
	va_start (args, format);
	_tmp0_ = self->priv->sink;
	_tmp1_ = g_strdup_vprintf (format, args);
	_tmp2_ = _tmp1_;
	proton_plus_cli_cli_output_sink_write_stdout (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	va_end (args);
}

void
proton_plus_cli_output_success (ProtonPlusCLIOutput* self,
                                const gchar* format,
                                ...)
{
	va_list args = {0};
	ProtonPlusCLICliOutputSink* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (format != NULL);
	va_start (args, format);
	_tmp0_ = self->priv->sink;
	_tmp1_ = g_strdup_vprintf (format, args);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (PROTON_PLUS_CLI_OUTPUT_GREEN, _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, PROTON_PLUS_CLI_OUTPUT_RESET, NULL);
	_tmp6_ = _tmp5_;
	proton_plus_cli_cli_output_sink_write_stdout (_tmp0_, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	va_end (args);
}

void
proton_plus_cli_output_error (ProtonPlusCLIOutput* self,
                              const gchar* format,
                              ...)
{
	va_list args = {0};
	ProtonPlusCLICliOutputSink* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (format != NULL);
	va_start (args, format);
	_tmp0_ = self->priv->sink;
	_tmp1_ = g_strdup_vprintf (format, args);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (PROTON_PLUS_CLI_OUTPUT_RED, _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, PROTON_PLUS_CLI_OUTPUT_RESET, NULL);
	_tmp6_ = _tmp5_;
	proton_plus_cli_cli_output_sink_write_stderr (_tmp0_, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	va_end (args);
}

void
proton_plus_cli_output_warning (ProtonPlusCLIOutput* self,
                                const gchar* format,
                                ...)
{
	va_list args = {0};
	ProtonPlusCLICliOutputSink* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (format != NULL);
	va_start (args, format);
	_tmp0_ = self->priv->sink;
	_tmp1_ = g_strdup_vprintf (format, args);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (PROTON_PLUS_CLI_OUTPUT_YELLOW, _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, PROTON_PLUS_CLI_OUTPUT_RESET, NULL);
	_tmp6_ = _tmp5_;
	proton_plus_cli_cli_output_sink_write_stdout (_tmp0_, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	va_end (args);
}

void
proton_plus_cli_output_header (ProtonPlusCLIOutput* self,
                               const gchar* format,
                               ...)
{
	va_list args = {0};
	ProtonPlusCLICliOutputSink* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (format != NULL);
	va_start (args, format);
	_tmp0_ = self->priv->sink;
	_tmp1_ = g_strdup_vprintf (format, args);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (PROTON_PLUS_CLI_OUTPUT_BOLD PROTON_PLUS_CLI_OUTPUT_BLUE, _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, PROTON_PLUS_CLI_OUTPUT_RESET, NULL);
	_tmp6_ = _tmp5_;
	proton_plus_cli_cli_output_sink_write_stdout (_tmp0_, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	va_end (args);
}

void
proton_plus_cli_output_flush_stdout (ProtonPlusCLIOutput* self)
{
	ProtonPlusCLICliOutputSink* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sink;
	proton_plus_cli_cli_output_sink_flush_stdout (_tmp0_);
}

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

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

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

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

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

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

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

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

void
proton_plus_cli_value_set_output (GValue* value,
                                  gpointer v_object)
{
	ProtonPlusCLIOutput * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_CLI_TYPE_OUTPUT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_CLI_TYPE_OUTPUT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		proton_plus_cli_output_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_cli_output_unref (old);
	}
}

void
proton_plus_cli_value_take_output (GValue* value,
                                   gpointer v_object)
{
	ProtonPlusCLIOutput * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_CLI_TYPE_OUTPUT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_CLI_TYPE_OUTPUT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_cli_output_unref (old);
	}
}

static void
proton_plus_cli_output_class_init (ProtonPlusCLIOutputClass * klass,
                                   gpointer klass_data)
{
	proton_plus_cli_output_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusCLIOutputClass *) klass)->finalize = proton_plus_cli_output_finalize;
	g_type_class_adjust_private_offset (klass, &ProtonPlusCLIOutput_private_offset);
}

static void
proton_plus_cli_output_instance_init (ProtonPlusCLIOutput * self,
                                      gpointer klass)
{
	self->priv = proton_plus_cli_output_get_instance_private (self);
	self->ref_count = 1;
}

static void
proton_plus_cli_output_finalize (ProtonPlusCLIOutput * obj)
{
	ProtonPlusCLIOutput * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_CLI_TYPE_OUTPUT, ProtonPlusCLIOutput);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->sink);
}

static GType
proton_plus_cli_output_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { proton_plus_cli_value_output_init, proton_plus_cli_value_output_free_value, proton_plus_cli_value_output_copy_value, proton_plus_cli_value_output_peek_pointer, "p", proton_plus_cli_value_output_collect_value, "p", proton_plus_cli_value_output_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusCLIOutputClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_cli_output_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusCLIOutput), 0, (GInstanceInitFunc) proton_plus_cli_output_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType proton_plus_cli_output_type_id;
	proton_plus_cli_output_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ProtonPlusCLIOutput", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ProtonPlusCLIOutput_private_offset = g_type_add_instance_private (proton_plus_cli_output_type_id, sizeof (ProtonPlusCLIOutputPrivate));
	return proton_plus_cli_output_type_id;
}

GType
proton_plus_cli_output_get_type (void)
{
	static volatile gsize proton_plus_cli_output_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_cli_output_type_id__once)) {
		GType proton_plus_cli_output_type_id;
		proton_plus_cli_output_type_id = proton_plus_cli_output_get_type_once ();
		g_once_init_leave (&proton_plus_cli_output_type_id__once, proton_plus_cli_output_type_id);
	}
	return proton_plus_cli_output_type_id__once;
}

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

void
proton_plus_cli_output_unref (gpointer instance)
{
	ProtonPlusCLIOutput * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PROTON_PLUS_CLI_OUTPUT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
proton_plus_cli_handler_get_instance_private (ProtonPlusCLIHandler* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusCLIHandler_private_offset);
}

ProtonPlusCLIHandler*
proton_plus_cli_handler_construct (GType object_type,
                                   GeeLinkedList* fixture_launchers,
                                   ProtonPlusCLICliOutputSink* output_sink)
{
	ProtonPlusCLIHandler* self = NULL;
	GeeLinkedList* _tmp0_;
	ProtonPlusCLICliOutputSink* _tmp1_ = NULL;
	ProtonPlusCLICliOutputSink* _tmp2_;
	ProtonPlusCLICliOutputSink* _tmp4_;
	ProtonPlusCLIOutput* _tmp5_;
	self = (ProtonPlusCLIHandler*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (fixture_launchers);
	_g_object_unref0 (self->priv->fixture_launchers);
	self->priv->fixture_launchers = _tmp0_;
	_tmp2_ = _g_object_ref0 (output_sink);
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		ProtonPlusCLITerminalCliOutputSink* _tmp3_;
		_tmp3_ = proton_plus_cli_terminal_cli_output_sink_new ();
		_g_object_unref0 (_tmp1_);
		_tmp1_ = (ProtonPlusCLICliOutputSink*) _tmp3_;
	}
	proton_plus_cli_handler_set_output_sink (self, _tmp1_);
	_tmp4_ = self->priv->_output_sink;
	_tmp5_ = proton_plus_cli_output_new (_tmp4_);
	_proton_plus_cli_output_unref0 (self->priv->output);
	self->priv->output = _tmp5_;
	_g_object_unref0 (_tmp1_);
	return self;
}

ProtonPlusCLIHandler*
proton_plus_cli_handler_new (GeeLinkedList* fixture_launchers,
                             ProtonPlusCLICliOutputSink* output_sink)
{
	return proton_plus_cli_handler_construct (PROTON_PLUS_CLI_TYPE_HANDLER, fixture_launchers, output_sink);
}

static void
proton_plus_cli_handler_run_data_free (gpointer _data)
{
	ProtonPlusCliHandlerRunData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerRunData, _data_);
}

static gpointer
_proton_plus_cli_handler_ref0 (gpointer self)
{
	return self ? proton_plus_cli_handler_ref (self) : NULL;
}

void
proton_plus_cli_handler_run (ProtonPlusCLIHandler* self,
                             gchar** args,
                             gint args_length1,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	ProtonPlusCliHandlerRunData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerRunData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_run_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_data_->args = args;
	_data_->args_length1 = args_length1;
	proton_plus_cli_handler_run_co (_data_);
}

gint
proton_plus_cli_handler_run_finish (ProtonPlusCLIHandler* self,
                                    GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
_proton_plus_cli_handler_on_progress_updated_proton_plus_utils_download_manager_progress_updated (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                  ProtonPlusServicesInstallJob* job,
                                                                                                  gpointer self)
{
	proton_plus_cli_handler_on_progress_updated ((ProtonPlusCLIHandler*) self, job);
}

static void
___lambda28_ (ProtonPlusCLIHandler* self,
              ProtonPlusServicesInstallJob* job,
              const gchar* message)
{
	ProtonPlusCLIOutput* _tmp0_;
	g_return_if_fail (job != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->output;
	proton_plus_cli_output_warning (_tmp0_, _ ("Warning: %s\n"), message, NULL);
}

static void
____lambda28__proton_plus_services_installation_service_steam_restart_recording_failed (ProtonPlusServicesInstallationService* _sender,
                                                                                        ProtonPlusServicesInstallJob* job,
                                                                                        const gchar* message,
                                                                                        gpointer self)
{
	___lambda28_ ((ProtonPlusCLIHandler*) self, job, message);
}

static void
proton_plus_cli_handler_run_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	ProtonPlusCliHandlerRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_run_co (_data_);
}

static gboolean
proton_plus_cli_handler_run_co (ProtonPlusCliHandlerRunData* _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;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->args_length1 < 2) {
		proton_plus_cli_handler_print_usage (_data_->self);
		_data_->result = 1;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->args[1];
	_data_->_tmp1_ = g_strdup (_data_->_tmp0_);
	_data_->command = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->command;
	if (g_strcmp0 (_data_->_tmp2_, PROTON_PLUS_CLI_CMD_VERSION) == 0) {
		_data_->_tmp3_ = _data_->self->priv->output;
		proton_plus_cli_output_info (_data_->_tmp3_, "ProtonPlus %s\n", APP_VERSION, NULL);
		_data_->result = 0;
		_g_free0 (_data_->command);
		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_->_tmp4_ = _data_->command;
	if (g_strcmp0 (_data_->_tmp4_, PROTON_PLUS_CLI_CMD_HELP) == 0) {
		proton_plus_cli_handler_print_usage (_data_->self);
		_data_->result = 0;
		_g_free0 (_data_->command);
		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_->_tmp8_ = _data_->command;
	if (g_strcmp0 (_data_->_tmp8_, PROTON_PLUS_CLI_CMD_LIST) != 0) {
		_data_->_tmp9_ = _data_->command;
		_data_->_tmp7_ = g_strcmp0 (_data_->_tmp9_, PROTON_PLUS_CLI_CMD_INSTALL) != 0;
	} else {
		_data_->_tmp7_ = FALSE;
	}
	if (_data_->_tmp7_) {
		_data_->_tmp10_ = _data_->command;
		_data_->_tmp6_ = g_strcmp0 (_data_->_tmp10_, PROTON_PLUS_CLI_CMD_UNINSTALL) != 0;
	} else {
		_data_->_tmp6_ = FALSE;
	}
	if (_data_->_tmp6_) {
		_data_->_tmp11_ = _data_->command;
		_data_->_tmp5_ = g_strcmp0 (_data_->_tmp11_, PROTON_PLUS_CLI_CMD_UPDATE) != 0;
	} else {
		_data_->_tmp5_ = FALSE;
	}
	if (_data_->_tmp5_) {
		_data_->_tmp12_ = _data_->self->priv->output;
		_data_->_tmp13_ = _data_->command;
		proton_plus_cli_output_error (_data_->_tmp12_, _ ("Error: Unknown command '%s'\n"), _data_->_tmp13_, NULL);
		proton_plus_cli_handler_print_usage (_data_->self);
		_data_->result = 1;
		_g_free0 (_data_->command);
		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_->command;
	if (g_strcmp0 (_data_->_tmp15_, PROTON_PLUS_CLI_CMD_INSTALL) == 0) {
		_data_->_tmp14_ = TRUE;
	} else {
		_data_->_tmp16_ = _data_->command;
		_data_->_tmp14_ = g_strcmp0 (_data_->_tmp16_, PROTON_PLUS_CLI_CMD_UPDATE) == 0;
	}
	if (_data_->_tmp14_) {
		_data_->_tmp17_ = proton_plus_utils_download_manager_get_instance ();
		_data_->_tmp18_ = _data_->_tmp17_;
		_data_->_tmp19_ = g_signal_connect (_data_->_tmp18_, "progress-updated", (GCallback) _proton_plus_cli_handler_on_progress_updated_proton_plus_utils_download_manager_progress_updated, _data_->self);
		_data_->self->priv->progress_updated_handler_id = _data_->_tmp19_;
	}
	_data_->_tmp22_ = _data_->command;
	if (g_strcmp0 (_data_->_tmp22_, PROTON_PLUS_CLI_CMD_INSTALL) == 0) {
		_data_->_tmp21_ = TRUE;
	} else {
		_data_->_tmp23_ = _data_->command;
		_data_->_tmp21_ = g_strcmp0 (_data_->_tmp23_, PROTON_PLUS_CLI_CMD_UNINSTALL) == 0;
	}
	if (_data_->_tmp21_) {
		_data_->_tmp20_ = TRUE;
	} else {
		_data_->_tmp24_ = _data_->command;
		_data_->_tmp20_ = g_strcmp0 (_data_->_tmp24_, PROTON_PLUS_CLI_CMD_UPDATE) == 0;
	}
	if (_data_->_tmp20_) {
		_data_->_tmp25_ = proton_plus_services_installation_service_get_instance ();
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = g_signal_connect (_data_->_tmp26_, "steam-restart-recording-failed", (GCallback) ____lambda28__proton_plus_services_installation_service_steam_restart_recording_failed, _data_->self);
		_data_->self->priv->steam_restart_recording_failed_handler_id = _data_->_tmp27_;
	}
	{
		static GQuark _tmp30_label0 = 0;
		static GQuark _tmp30_label1 = 0;
		static GQuark _tmp30_label2 = 0;
		static GQuark _tmp30_label3 = 0;
		_data_->_state_ = 1;
		proton_plus_cli_handler_load_launchers (_data_->self, proton_plus_cli_handler_run_ready, _data_);
		return FALSE;
		_state_1:
		if (!proton_plus_cli_handler_load_launchers_finish (_data_->self, _data_->_res_)) {
			_data_->result = 1;
			{
				proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
			}
			_g_free0 (_data_->command);
			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_->command;
		_data_->_tmp31_ = 0U;
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp31_ = (NULL == _data_->_tmp29_) ? 0 : g_quark_from_string (_data_->_tmp29_);
		if (_data_->_tmp31_ == ((0 != _tmp30_label0) ? _tmp30_label0 : (_tmp30_label0 = g_quark_from_static_string (PROTON_PLUS_CLI_CMD_LIST)))) {
			switch (0) {
				default:
				{
					_data_->result = proton_plus_cli_handler_handle_list (_data_->self, _data_->args, (gint) _data_->args_length1);
					{
						proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
					}
					_g_free0 (_data_->command);
					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;
				}
			}
		} else if (_data_->_tmp31_ == ((0 != _tmp30_label1) ? _tmp30_label1 : (_tmp30_label1 = g_quark_from_static_string (PROTON_PLUS_CLI_CMD_INSTALL)))) {
			switch (0) {
				default:
				{
					_data_->_state_ = 2;
					proton_plus_cli_handler_handle_install (_data_->self, _data_->args, (gint) _data_->args_length1, proton_plus_cli_handler_run_ready, _data_);
					return FALSE;
					_state_2:
					_data_->result = proton_plus_cli_handler_handle_install_finish (_data_->self, _data_->_res_);
					{
						proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
					}
					_g_free0 (_data_->command);
					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;
				}
			}
		} else if (_data_->_tmp31_ == ((0 != _tmp30_label2) ? _tmp30_label2 : (_tmp30_label2 = g_quark_from_static_string (PROTON_PLUS_CLI_CMD_UNINSTALL)))) {
			switch (0) {
				default:
				{
					_data_->_state_ = 3;
					proton_plus_cli_handler_handle_uninstall (_data_->self, _data_->args, (gint) _data_->args_length1, proton_plus_cli_handler_run_ready, _data_);
					return FALSE;
					_state_3:
					_data_->result = proton_plus_cli_handler_handle_uninstall_finish (_data_->self, _data_->_res_);
					{
						proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
					}
					_g_free0 (_data_->command);
					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;
				}
			}
		} else if (_data_->_tmp31_ == ((0 != _tmp30_label3) ? _tmp30_label3 : (_tmp30_label3 = g_quark_from_static_string (PROTON_PLUS_CLI_CMD_UPDATE)))) {
			switch (0) {
				default:
				{
					_data_->_state_ = 4;
					proton_plus_cli_handler_handle_update (_data_->self, _data_->args, (gint) _data_->args_length1, proton_plus_cli_handler_run_ready, _data_);
					return FALSE;
					_state_4:
					_data_->result = proton_plus_cli_handler_handle_update_finish (_data_->self, _data_->_res_);
					{
						proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
					}
					_g_free0 (_data_->command);
					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;
				}
			}
		} else {
			switch (0) {
				default:
				{
					_data_->result = 1;
					{
						proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
					}
					_g_free0 (_data_->command);
					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;
				}
			}
		}
	}
	__finally0:
	{
		proton_plus_cli_handler_disconnect_runtime_signals (_data_->self);
	}
	_g_free0 (_data_->command);
	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;
}

static void
proton_plus_cli_handler_disconnect_runtime_signals (ProtonPlusCLIHandler* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->progress_updated_handler_id != ((gulong) 0)) {
		ProtonPlusUtilsDownloadManager* _tmp0_;
		ProtonPlusUtilsDownloadManager* _tmp1_;
		_tmp0_ = proton_plus_utils_download_manager_get_instance ();
		_tmp1_ = _tmp0_;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->progress_updated_handler_id);
		self->priv->progress_updated_handler_id = (gulong) 0;
	}
	if (self->priv->steam_restart_recording_failed_handler_id != ((gulong) 0)) {
		ProtonPlusServicesInstallationService* _tmp2_;
		ProtonPlusServicesInstallationService* _tmp3_;
		_tmp2_ = proton_plus_services_installation_service_get_instance ();
		_tmp3_ = _tmp2_;
		g_signal_handler_disconnect ((GObject*) _tmp3_, self->priv->steam_restart_recording_failed_handler_id);
		self->priv->steam_restart_recording_failed_handler_id = (gulong) 0;
	}
}

static gint
proton_plus_cli_handler_handle_list (ProtonPlusCLIHandler* self,
                                     gchar** args,
                                     gint args_length1)
{
	ProtonPlusModelsLauncher* launcher = NULL;
	const gchar* _tmp15_;
	ProtonPlusModelsLauncher* _tmp16_;
	ProtonPlusModelsLauncher* _tmp17_;
	ProtonPlusCLIOutput* _tmp18_;
	ProtonPlusModelsLauncher* _tmp19_;
	const gchar* _tmp20_;
	gboolean found = FALSE;
	ProtonPlusModelsLauncher* _tmp21_;
	ProtonPlusModelsGroup** _tmp22_;
	gint _tmp22__length1;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	if (args_length1 < 3) {
		ProtonPlusCLIOutput* _tmp0_;
		_tmp0_ = self->priv->output;
		proton_plus_cli_output_header (_tmp0_, _ ("Detected launchers:\n"), NULL);
		{
			GeeLinkedList* _launcher_list = NULL;
			GeeLinkedList* _tmp1_;
			gint _launcher_size = 0;
			GeeLinkedList* _tmp2_;
			gint _tmp3_;
			gint _tmp4_;
			gint _launcher_index = 0;
			_tmp1_ = self->priv->launchers;
			_launcher_list = _tmp1_;
			_tmp2_ = _launcher_list;
			_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
			_tmp4_ = _tmp3_;
			_launcher_size = _tmp4_;
			_launcher_index = -1;
			while (TRUE) {
				gint _tmp5_;
				gint _tmp6_;
				ProtonPlusModelsLauncher* launcher = NULL;
				GeeLinkedList* _tmp7_;
				gpointer _tmp8_;
				ProtonPlusCLIOutput* _tmp9_;
				ProtonPlusModelsLauncher* _tmp10_;
				gchar* _tmp11_;
				gchar* _tmp12_;
				ProtonPlusModelsLauncher* _tmp13_;
				const gchar* _tmp14_;
				_launcher_index = _launcher_index + 1;
				_tmp5_ = _launcher_index;
				_tmp6_ = _launcher_size;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = _launcher_list;
				_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _launcher_index);
				launcher = (ProtonPlusModelsLauncher*) _tmp8_;
				_tmp9_ = self->priv->output;
				_tmp10_ = launcher;
				_tmp11_ = proton_plus_cli_handler_get_launcher_id (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = launcher;
				_tmp14_ = _tmp13_->title;
				proton_plus_cli_output_info (_tmp9_, "  %-45s (%s)\n", _tmp12_, _tmp14_, NULL);
				_g_free0 (_tmp12_);
				_g_object_unref0 (launcher);
			}
		}
		result = 0;
		return result;
	}
	_tmp15_ = args[2];
	_tmp16_ = proton_plus_cli_handler_find_launcher (self, _tmp15_);
	launcher = _tmp16_;
	_tmp17_ = launcher;
	if (_tmp17_ == NULL) {
		result = 1;
		_g_object_unref0 (launcher);
		return result;
	}
	_tmp18_ = self->priv->output;
	_tmp19_ = launcher;
	_tmp20_ = _tmp19_->title;
	proton_plus_cli_output_header (_tmp18_, _ ("Installed runners for %s:\n"), _tmp20_, NULL);
	found = FALSE;
	_tmp21_ = launcher;
	_tmp22_ = _tmp21_->groups;
	_tmp22__length1 = _tmp21_->groups_length1;
	{
		ProtonPlusModelsGroup** group_collection = NULL;
		gint group_collection_length1 = 0;
		gint _group_collection_size_ = 0;
		gint group_it = 0;
		group_collection = _tmp22_;
		group_collection_length1 = _tmp22__length1;
		for (group_it = 0; group_it < group_collection_length1; group_it = group_it + 1) {
			ProtonPlusModelsGroup* _tmp23_;
			ProtonPlusModelsGroup* group = NULL;
			_tmp23_ = _g_object_ref0 (group_collection[group_it]);
			group = _tmp23_;
			{
				ProtonPlusModelsGroup* _tmp24_;
				GeeList* installed = NULL;
				ProtonPlusModelsGroup* _tmp25_;
				GeeList* _tmp26_;
				gboolean group_found = FALSE;
				_tmp24_ = group;
				proton_plus_models_group_refresh_installed_state (_tmp24_);
				_tmp25_ = group;
				_tmp26_ = proton_plus_models_group_get_installed_tool_snapshot (_tmp25_);
				installed = _tmp26_;
				group_found = FALSE;
				{
					GeeList* _entry_list = NULL;
					GeeList* _tmp27_;
					gint _entry_size = 0;
					GeeList* _tmp28_;
					gint _tmp29_;
					gint _tmp30_;
					gint _entry_index = 0;
					_tmp27_ = installed;
					_entry_list = _tmp27_;
					_tmp28_ = _entry_list;
					_tmp29_ = gee_collection_get_size ((GeeCollection*) _tmp28_);
					_tmp30_ = _tmp29_;
					_entry_size = _tmp30_;
					_entry_index = -1;
					while (TRUE) {
						gint _tmp31_;
						gint _tmp32_;
						ProtonPlusModelsInstalledToolEntry* entry = NULL;
						GeeList* _tmp33_;
						gpointer _tmp34_;
						ProtonPlusModelsInstalledToolEntry* _tmp35_;
						const gchar* _tmp36_;
						const gchar* _tmp37_;
						ProtonPlusCLIOutput* _tmp42_;
						ProtonPlusModelsInstalledToolEntry* _tmp43_;
						const gchar* _tmp44_;
						const gchar* _tmp45_;
						_entry_index = _entry_index + 1;
						_tmp31_ = _entry_index;
						_tmp32_ = _entry_size;
						if (!(_tmp31_ < _tmp32_)) {
							break;
						}
						_tmp33_ = _entry_list;
						_tmp34_ = gee_list_get (_tmp33_, _entry_index);
						entry = (ProtonPlusModelsInstalledToolEntry*) _tmp34_;
						_tmp35_ = entry;
						_tmp36_ = proton_plus_models_installed_tool_entry_get_directory_name (_tmp35_);
						_tmp37_ = _tmp36_;
						if (g_strcmp0 (_tmp37_, "LegacyRuntime") == 0) {
							_g_object_unref0 (entry);
							continue;
						}
						if (!group_found) {
							ProtonPlusCLIOutput* _tmp38_;
							ProtonPlusModelsGroup* _tmp39_;
							const gchar* _tmp40_;
							const gchar* _tmp41_;
							_tmp38_ = self->priv->output;
							_tmp39_ = group;
							_tmp40_ = proton_plus_models_group_get_title (_tmp39_);
							_tmp41_ = _tmp40_;
							proton_plus_cli_output_info (_tmp38_, "\n%s:\n", _tmp41_, NULL);
							group_found = TRUE;
						}
						_tmp42_ = self->priv->output;
						_tmp43_ = entry;
						_tmp44_ = proton_plus_models_installed_tool_entry_get_display_title (_tmp43_);
						_tmp45_ = _tmp44_;
						proton_plus_cli_output_info (_tmp42_, "  %s\n", _tmp45_, NULL);
						found = TRUE;
						_g_object_unref0 (entry);
					}
				}
				_g_object_unref0 (installed);
				_g_object_unref0 (group);
			}
		}
	}
	if (!found) {
		ProtonPlusCLIOutput* _tmp46_;
		_tmp46_ = self->priv->output;
		proton_plus_cli_output_warning (_tmp46_, _ ("No runners installed\n"), NULL);
	}
	result = 0;
	_g_object_unref0 (launcher);
	return result;
}

static void
proton_plus_cli_handler_handle_install_data_free (gpointer _data)
{
	ProtonPlusCliHandlerHandleInstallData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerHandleInstallData, _data_);
}

static void
proton_plus_cli_handler_handle_install (ProtonPlusCLIHandler* self,
                                        gchar** args,
                                        gint args_length1,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleInstallData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerHandleInstallData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_handle_install_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_data_->args = args;
	_data_->args_length1 = args_length1;
	proton_plus_cli_handler_handle_install_co (_data_);
}

static gint
proton_plus_cli_handler_handle_install_finish (ProtonPlusCLIHandler* self,
                                               GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerHandleInstallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_handle_install_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleInstallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_handle_install_co (_data_);
}

static gboolean
proton_plus_cli_handler_handle_install_co (ProtonPlusCliHandlerHandleInstallData* _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 (!proton_plus_cli_handler_validate_args (_data_->self, _data_->args, (gint) _data_->args_length1, 4, "protonplus install <launcher_id> <runner_id> [latest]")) {
		_data_->result = 1;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->args[2];
	_data_->_tmp1_ = proton_plus_cli_handler_find_launcher (_data_->self, _data_->_tmp0_);
	_data_->launcher = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->launcher;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->launcher);
		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_->launcher;
	_data_->_tmp4_ = _data_->args[3];
	_data_->_tmp5_ = proton_plus_cli_handler_find_runner (_data_->self, _data_->_tmp3_, _data_->_tmp4_);
	_data_->runner = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->runner;
	if (_data_->_tmp6_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->runner);
		_g_object_unref0 (_data_->launcher);
		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_->runner;
	_data_->_tmp8_ = proton_plus_cli_handler_get_provider_tool (_data_->self, _data_->_tmp7_, PROTON_PLUS_CLI_CMD_INSTALL);
	_data_->provider_tool = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->provider_tool;
	if (_data_->_tmp9_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->provider_tool);
		_g_object_unref0 (_data_->runner);
		_g_object_unref0 (_data_->launcher);
		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_->args_length1 >= 5) {
		_data_->_tmp11_ = _data_->args[4];
		_data_->_tmp10_ = g_strcmp0 (_data_->_tmp11_, PROTON_PLUS_CLI_OPT_LATEST) == 0;
	} else {
		_data_->_tmp10_ = FALSE;
	}
	_data_->use_latest = _data_->_tmp10_;
	if (_data_->use_latest) {
		_data_->_tmp13_ = _data_->provider_tool;
		_data_->_state_ = 1;
		proton_plus_cli_handler_install_latest (_data_->self, _data_->_tmp13_, proton_plus_cli_handler_handle_install_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = proton_plus_cli_handler_install_latest_finish (_data_->self, _data_->_res_);
	} else {
		_data_->_tmp14_ = _data_->provider_tool;
		_data_->_state_ = 2;
		proton_plus_cli_handler_install_interactive (_data_->self, _data_->_tmp14_, proton_plus_cli_handler_handle_install_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp12_ = proton_plus_cli_handler_install_interactive_finish (_data_->self, _data_->_res_);
	}
	_data_->result = _data_->_tmp12_;
	_g_object_unref0 (_data_->provider_tool);
	_g_object_unref0 (_data_->runner);
	_g_object_unref0 (_data_->launcher);
	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_cli_handler_handle_uninstall_data_free (gpointer _data)
{
	ProtonPlusCliHandlerHandleUninstallData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerHandleUninstallData, _data_);
}

static void
proton_plus_cli_handler_handle_uninstall (ProtonPlusCLIHandler* self,
                                          gchar** args,
                                          gint args_length1,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleUninstallData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerHandleUninstallData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_handle_uninstall_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_data_->args = args;
	_data_->args_length1 = args_length1;
	proton_plus_cli_handler_handle_uninstall_co (_data_);
}

static gint
proton_plus_cli_handler_handle_uninstall_finish (ProtonPlusCLIHandler* self,
                                                 GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerHandleUninstallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_handle_uninstall_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleUninstallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_handle_uninstall_co (_data_);
}

static gboolean
proton_plus_cli_handler_handle_uninstall_co (ProtonPlusCliHandlerHandleUninstallData* _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:
	if (!proton_plus_cli_handler_validate_args (_data_->self, _data_->args, (gint) _data_->args_length1, 4, "protonplus uninstall <launcher_id> <runner_id|all> [all]")) {
		_data_->result = 1;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->args[2];
	_data_->_tmp1_ = proton_plus_cli_handler_find_launcher (_data_->self, _data_->_tmp0_);
	_data_->launcher = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->launcher;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->launcher);
		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_->args[3];
	if (g_strcmp0 (_data_->_tmp3_, PROTON_PLUS_CLI_OPT_ALL) == 0) {
		_data_->_tmp4_ = _data_->launcher;
		_data_->_state_ = 1;
		proton_plus_cli_handler_uninstall_launcher_all (_data_->self, _data_->_tmp4_, proton_plus_cli_handler_handle_uninstall_ready, _data_);
		return FALSE;
		_state_1:
		_data_->result = proton_plus_cli_handler_uninstall_launcher_all_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->launcher);
		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_ = _data_->launcher;
	_data_->_tmp6_ = _data_->args[3];
	_data_->_tmp7_ = proton_plus_cli_handler_find_runner (_data_->self, _data_->_tmp5_, _data_->_tmp6_);
	_data_->runner = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->runner;
	if (_data_->_tmp8_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->runner);
		_g_object_unref0 (_data_->launcher);
		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_->_tmp9_ = _data_->runner;
	_data_->_tmp10_ = proton_plus_cli_handler_get_provider_tool (_data_->self, _data_->_tmp9_, PROTON_PLUS_CLI_CMD_UNINSTALL);
	_data_->provider_tool = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->provider_tool;
	if (_data_->_tmp11_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->provider_tool);
		_g_object_unref0 (_data_->runner);
		_g_object_unref0 (_data_->launcher);
		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_->args_length1 >= 5) {
		_data_->_tmp13_ = _data_->args[4];
		_data_->_tmp12_ = g_strcmp0 (_data_->_tmp13_, PROTON_PLUS_CLI_OPT_ALL) == 0;
	} else {
		_data_->_tmp12_ = FALSE;
	}
	_data_->uninstall_all = _data_->_tmp12_;
	if (_data_->uninstall_all) {
		_data_->_tmp15_ = _data_->provider_tool;
		_data_->_state_ = 2;
		proton_plus_cli_handler_uninstall_runner_all (_data_->self, _data_->_tmp15_, proton_plus_cli_handler_handle_uninstall_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp14_ = proton_plus_cli_handler_uninstall_runner_all_finish (_data_->self, _data_->_res_);
	} else {
		_data_->_tmp16_ = _data_->provider_tool;
		_data_->_state_ = 3;
		proton_plus_cli_handler_uninstall_interactive (_data_->self, _data_->_tmp16_, proton_plus_cli_handler_handle_uninstall_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp14_ = proton_plus_cli_handler_uninstall_interactive_finish (_data_->self, _data_->_res_);
	}
	_data_->result = _data_->_tmp14_;
	_g_object_unref0 (_data_->provider_tool);
	_g_object_unref0 (_data_->runner);
	_g_object_unref0 (_data_->launcher);
	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_cli_handler_handle_update_data_free (gpointer _data)
{
	ProtonPlusCliHandlerHandleUpdateData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerHandleUpdateData, _data_);
}

static void
proton_plus_cli_handler_handle_update (ProtonPlusCLIHandler* self,
                                       gchar** args,
                                       gint args_length1,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleUpdateData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerHandleUpdateData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_handle_update_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_data_->args = args;
	_data_->args_length1 = args_length1;
	proton_plus_cli_handler_handle_update_co (_data_);
}

static gint
proton_plus_cli_handler_handle_update_finish (ProtonPlusCLIHandler* self,
                                              GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerHandleUpdateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_handle_update_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	ProtonPlusCliHandlerHandleUpdateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_handle_update_co (_data_);
}

static gboolean
proton_plus_cli_handler_handle_update_co (ProtonPlusCliHandlerHandleUpdateData* _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:
	if (!proton_plus_cli_handler_validate_args (_data_->self, _data_->args, (gint) _data_->args_length1, 3, "protonplus update <all|launcher_id> [runner_id]")) {
		_data_->result = 1;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->args[2];
	if (g_strcmp0 (_data_->_tmp0_, PROTON_PLUS_CLI_OPT_ALL) == 0) {
		_data_->_state_ = 1;
		proton_plus_cli_handler_update_all (_data_->self, proton_plus_cli_handler_handle_update_ready, _data_);
		return FALSE;
		_state_1:
		_data_->result = proton_plus_cli_handler_update_all_finish (_data_->self, _data_->_res_);
		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_->_tmp1_ = _data_->args[2];
	_data_->_tmp2_ = proton_plus_cli_handler_find_launcher (_data_->self, _data_->_tmp1_);
	_data_->launcher = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->launcher;
	if (_data_->_tmp3_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->launcher);
		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_->args_length1 >= 4) {
		_data_->_tmp4_ = _data_->launcher;
		_data_->_tmp5_ = _data_->args[3];
		_data_->_tmp6_ = proton_plus_cli_handler_find_runner (_data_->self, _data_->_tmp4_, _data_->_tmp5_);
		_data_->runner = _data_->_tmp6_;
		_data_->_tmp7_ = _data_->runner;
		if (_data_->_tmp7_ == NULL) {
			_data_->result = 1;
			_g_object_unref0 (_data_->runner);
			_g_object_unref0 (_data_->launcher);
			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_->_tmp8_ = _data_->runner;
		_data_->_tmp9_ = proton_plus_cli_handler_get_provider_tool (_data_->self, _data_->_tmp8_, PROTON_PLUS_CLI_CMD_UPDATE);
		_data_->provider_tool = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->provider_tool;
		if (_data_->_tmp10_ == NULL) {
			_data_->result = 1;
			_g_object_unref0 (_data_->provider_tool);
			_g_object_unref0 (_data_->runner);
			_g_object_unref0 (_data_->launcher);
			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_->_tmp11_ = _data_->provider_tool;
		_data_->_state_ = 2;
		proton_plus_cli_handler_update_runner (_data_->self, _data_->_tmp11_, proton_plus_cli_handler_handle_update_ready, _data_);
		return FALSE;
		_state_2:
		_data_->result = proton_plus_cli_handler_update_runner_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->provider_tool);
		_g_object_unref0 (_data_->runner);
		_g_object_unref0 (_data_->launcher);
		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_->_tmp12_ = _data_->launcher;
	_data_->_state_ = 3;
	proton_plus_cli_handler_update_launcher (_data_->self, _data_->_tmp12_, proton_plus_cli_handler_handle_update_ready, _data_);
	return FALSE;
	_state_3:
	_data_->result = proton_plus_cli_handler_update_launcher_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->launcher);
	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_cli_handler_install_latest_data_free (gpointer _data)
{
	ProtonPlusCliHandlerInstallLatestData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->provider_tool);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerInstallLatestData, _data_);
}

static void
proton_plus_cli_handler_install_latest (ProtonPlusCLIHandler* self,
                                        ProtonPlusModelsToolsProviderTool* provider_tool,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusCliHandlerInstallLatestData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (provider_tool != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerInstallLatestData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_install_latest_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (provider_tool);
	_g_object_unref0 (_data_->provider_tool);
	_data_->provider_tool = _tmp1_;
	proton_plus_cli_handler_install_latest_co (_data_);
}

static gint
proton_plus_cli_handler_install_latest_finish (ProtonPlusCLIHandler* self,
                                               GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerInstallLatestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_install_latest_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ProtonPlusCliHandlerInstallLatestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_install_latest_co (_data_);
}

static gboolean
proton_plus_cli_handler_install_latest_co (ProtonPlusCliHandlerInstallLatestData* _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_tool_get_release_catalog ((ProtonPlusModelsTool*) _data_->provider_tool);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->catalog = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->catalog;
	if (_data_->_tmp3_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->catalog);
		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_->_tmp4_ = _data_->catalog;
	_data_->_state_ = 1;
	proton_plus_models_release_catalog_fetch_latest_eligible_release (_data_->_tmp4_, proton_plus_cli_handler_install_latest_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = proton_plus_models_release_catalog_fetch_latest_eligible_release_finish (_data_->_tmp4_, _data_->_res_);
	_data_->_result_ = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->_result_;
	_data_->_tmp7_ = proton_plus_models_release_lookup_result_get_succeeded (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	if (!_data_->_tmp8_) {
		_data_->_tmp9_ = _data_->self->priv->output;
		_data_->_tmp10_ = _data_->_result_;
		_data_->_tmp11_ = proton_plus_models_release_lookup_result_get_code (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = proton_plus_get_return_code_message (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		proton_plus_cli_output_error (_data_->_tmp9_, _ ("Error: Failed to load releases: %s\n"), _data_->_tmp14_, NULL);
		_g_free0 (_data_->_tmp14_);
		_data_->result = 1;
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		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_->_result_;
	_data_->_tmp16_ = proton_plus_models_release_lookup_result_get_has_release (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	if (!_data_->_tmp17_) {
		_data_->_tmp18_ = _data_->self->priv->output;
		proton_plus_cli_output_error (_data_->_tmp18_, _ ("Error: No releases are available\n"), NULL);
		_data_->result = 1;
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		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_->_tmp19_ = _data_->self->priv->output;
	_data_->_tmp20_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->provider_tool);
	_data_->_tmp21_ = _data_->_tmp20_;
	proton_plus_cli_output_info (_data_->_tmp19_, _ ("Installing %s Latest...\n"), _data_->_tmp21_, NULL);
	_data_->_tmp22_ = _data_->_result_;
	_data_->_tmp23_ = proton_plus_models_release_lookup_result_require_release (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = proton_plus_cli_handler_create_install_job (_data_->self, _data_->_tmp24_, _data_->provider_tool, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_LATEST, NULL);
	_data_->_tmp26_ = _data_->_tmp25_;
	_g_object_unref0 (_data_->_tmp24_);
	_data_->job = _data_->_tmp26_;
	_data_->_tmp27_ = _data_->job;
	_data_->_state_ = 2;
	proton_plus_services_install_job_install (_data_->_tmp27_, proton_plus_cli_handler_install_latest_ready, _data_);
	return FALSE;
	_state_2:
	_data_->code = proton_plus_services_install_job_install_finish (_data_->_tmp27_, _data_->_res_);
	_data_->_tmp28_ = _data_->self->priv->output;
	proton_plus_cli_output_info (_data_->_tmp28_, "\r\033[2K\r", NULL);
	_data_->success = _data_->code == PROTON_PLUS_RETURN_CODE_RUNNER_INSTALLED;
	if (_data_->success) {
		_data_->_tmp29_ = _data_->self->priv->output;
		_data_->_tmp30_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->provider_tool);
		_data_->_tmp31_ = _data_->_tmp30_;
		proton_plus_cli_output_success (_data_->_tmp29_, _ ("Successfully installed %s Latest\n"), _data_->_tmp31_, NULL);
	} else {
		_data_->_tmp32_ = _data_->self->priv->output;
		_data_->_tmp33_ = proton_plus_get_return_code_message (_data_->code);
		_data_->_tmp34_ = _data_->_tmp33_;
		proton_plus_cli_output_error (_data_->_tmp32_, _ ("Error: Installation failed: %s\n"), _data_->_tmp34_, NULL);
		_g_free0 (_data_->_tmp34_);
	}
	if (_data_->success) {
		_data_->_tmp35_ = 0;
	} else {
		_data_->_tmp35_ = 1;
	}
	_data_->result = _data_->_tmp35_;
	_g_object_unref0 (_data_->job);
	_g_object_unref0 (_data_->_result_);
	_g_object_unref0 (_data_->catalog);
	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_cli_handler_install_interactive_data_free (gpointer _data)
{
	ProtonPlusCliHandlerInstallInteractiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->provider_tool);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerInstallInteractiveData, _data_);
}

static void
proton_plus_cli_handler_install_interactive (ProtonPlusCLIHandler* self,
                                             ProtonPlusModelsToolsProviderTool* provider_tool,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ProtonPlusCliHandlerInstallInteractiveData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (provider_tool != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerInstallInteractiveData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_install_interactive_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (provider_tool);
	_g_object_unref0 (_data_->provider_tool);
	_data_->provider_tool = _tmp1_;
	proton_plus_cli_handler_install_interactive_co (_data_);
}

static gint
proton_plus_cli_handler_install_interactive_finish (ProtonPlusCLIHandler* self,
                                                    GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerInstallInteractiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_install_interactive_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ProtonPlusCliHandlerInstallInteractiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_install_interactive_co (_data_);
}

static gboolean
proton_plus_cli_handler_install_interactive_co (ProtonPlusCliHandlerInstallInteractiveData* _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_tool_get_release_catalog ((ProtonPlusModelsTool*) _data_->provider_tool);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->catalog = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->catalog;
	if (_data_->_tmp3_ == NULL) {
		_data_->result = 1;
		_g_object_unref0 (_data_->catalog);
		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_cli_handler_load_runner_releases (_data_->self, _data_->provider_tool, proton_plus_cli_handler_install_interactive_ready, _data_);
	return FALSE;
	_state_1:
	_data_->code = proton_plus_cli_handler_load_runner_releases_finish (_data_->self, _data_->_res_);
	if (_data_->code != PROTON_PLUS_RETURN_CODE_RELEASES_LOADED) {
		_data_->_tmp4_ = TRUE;
	} else {
		_data_->_tmp5_ = _data_->catalog;
		_data_->_tmp6_ = proton_plus_models_release_catalog_get_releases (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp4_ = _data_->_tmp9_ == 0;
	}
	if (_data_->_tmp4_) {
		_data_->result = 1;
		_g_object_unref0 (_data_->catalog);
		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_ = _data_->self->priv->output;
	_data_->_tmp11_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->provider_tool);
	_data_->_tmp12_ = _data_->_tmp11_;
	proton_plus_cli_output_header (_data_->_tmp10_, _ ("Available releases for %s:\n"), _data_->_tmp12_, NULL);
	{
		_data_->i = 0;
		{
			_data_->_tmp13_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp13_) {
					_data_->_tmp14_ = _data_->i;
					_data_->i = _data_->_tmp14_ + 1;
				}
				_data_->_tmp13_ = FALSE;
				_data_->_tmp15_ = _data_->catalog;
				_data_->_tmp16_ = proton_plus_models_release_catalog_get_releases (_data_->_tmp15_);
				_data_->_tmp17_ = _data_->_tmp16_;
				_data_->_tmp18_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp17_);
				_data_->_tmp19_ = _data_->_tmp18_;
				if (!(_data_->i < _data_->_tmp19_)) {
					break;
				}
				_data_->_tmp20_ = _data_->catalog;
				_data_->_tmp21_ = proton_plus_models_release_catalog_get_releases (_data_->_tmp20_);
				_data_->_tmp22_ = _data_->_tmp21_;
				_data_->_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp22_, _data_->i);
				_data_->_tmp24_ = (ProtonPlusModelsRelease*) _data_->_tmp23_;
				_data_->_tmp25_ = PROTON_PLUS_MODELS_IS_RELEASE (_data_->_tmp24_) ? ((ProtonPlusModelsRelease*) _data_->_tmp24_) : NULL;
				if (_data_->_tmp25_ == NULL) {
					_g_object_unref0 (_data_->_tmp24_);
				}
				_data_->release = _data_->_tmp25_;
				_data_->_tmp26_ = _data_->self->priv->output;
				_data_->_tmp27_ = _data_->release;
				_data_->_tmp28_ = proton_plus_models_release_get_title (_data_->_tmp27_);
				_data_->_tmp29_ = _data_->_tmp28_;
				_data_->_tmp30_ = _data_->release;
				_data_->_tmp31_ = proton_plus_models_release_get_release_date (_data_->_tmp30_);
				_data_->_tmp32_ = _data_->_tmp31_;
				proton_plus_cli_output_info (_data_->_tmp26_, "%d. %s (%s)\n", _data_->i + 1, _data_->_tmp29_, _data_->_tmp32_, NULL);
				_g_object_unref0 (_data_->release);
			}
		}
	}
	_data_->_tmp33_ = _data_->catalog;
	_data_->_tmp34_ = proton_plus_models_release_catalog_get_releases (_data_->_tmp33_);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->index = proton_plus_cli_handler_read_user_selection (_data_->self, _ ("Select release number"), (gint) _data_->_tmp37_);
	if (_data_->index < 0) {
		_data_->result = 1;
		_g_object_unref0 (_data_->catalog);
		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_->_tmp38_ = _data_->catalog;
	_data_->_tmp39_ = proton_plus_models_release_catalog_get_releases (_data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	_data_->_tmp41_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp40_, _data_->index);
	_data_->_tmp42_ = (ProtonPlusModelsRelease*) _data_->_tmp41_;
	_data_->_tmp43_ = PROTON_PLUS_MODELS_IS_RELEASE (_data_->_tmp42_) ? ((ProtonPlusModelsRelease*) _data_->_tmp42_) : NULL;
	if (_data_->_tmp43_ == NULL) {
		_g_object_unref0 (_data_->_tmp42_);
	}
	_data_->selected = _data_->_tmp43_;
	_data_->_tmp44_ = _data_->self->priv->output;
	_data_->_tmp45_ = _data_->selected;
	_data_->_tmp46_ = proton_plus_models_release_get_title (_data_->_tmp45_);
	_data_->_tmp47_ = _data_->_tmp46_;
	proton_plus_cli_output_info (_data_->_tmp44_, _ ("Installing %s...\n"), _data_->_tmp47_, NULL);
	_data_->_tmp48_ = _data_->selected;
	_data_->_tmp49_ = proton_plus_cli_handler_create_install_job (_data_->self, _data_->_tmp48_, _data_->provider_tool, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_VERSIONED, NULL);
	_data_->job = _data_->_tmp49_;
	_data_->_tmp50_ = _data_->job;
	_data_->_state_ = 2;
	proton_plus_services_install_job_install (_data_->_tmp50_, proton_plus_cli_handler_install_interactive_ready, _data_);
	return FALSE;
	_state_2:
	_data_->code = proton_plus_services_install_job_install_finish (_data_->_tmp50_, _data_->_res_);
	_data_->_tmp51_ = _data_->self->priv->output;
	proton_plus_cli_output_info (_data_->_tmp51_, "\r\033[2K\r", NULL);
	_data_->success = _data_->code == PROTON_PLUS_RETURN_CODE_RUNNER_INSTALLED;
	if (_data_->success) {
		_data_->_tmp52_ = _data_->self->priv->output;
		_data_->_tmp53_ = _data_->selected;
		_data_->_tmp54_ = proton_plus_models_release_get_title (_data_->_tmp53_);
		_data_->_tmp55_ = _data_->_tmp54_;
		proton_plus_cli_output_success (_data_->_tmp52_, _ ("Successfully installed %s\n"), _data_->_tmp55_, NULL);
	} else {
		_data_->_tmp56_ = _data_->self->priv->output;
		_data_->_tmp57_ = proton_plus_get_return_code_message (_data_->code);
		_data_->_tmp58_ = _data_->_tmp57_;
		proton_plus_cli_output_error (_data_->_tmp56_, _ ("Error: Installation failed: %s\n"), _data_->_tmp58_, NULL);
		_g_free0 (_data_->_tmp58_);
	}
	if (_data_->success) {
		_data_->_tmp59_ = 0;
	} else {
		_data_->_tmp59_ = 1;
	}
	_data_->result = _data_->_tmp59_;
	_g_object_unref0 (_data_->job);
	_g_object_unref0 (_data_->selected);
	_g_object_unref0 (_data_->catalog);
	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_cli_handler_uninstall_interactive_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUninstallInteractiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUninstallInteractiveData, _data_);
}

static void
proton_plus_cli_handler_uninstall_interactive (ProtonPlusCLIHandler* self,
                                               ProtonPlusModelsToolsProviderTool* runner,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallInteractiveData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUninstallInteractiveData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_uninstall_interactive_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	proton_plus_cli_handler_uninstall_interactive_co (_data_);
}

static gint
proton_plus_cli_handler_uninstall_interactive_finish (ProtonPlusCLIHandler* self,
                                                      GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUninstallInteractiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_uninstall_interactive_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallInteractiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_uninstall_interactive_co (_data_);
}

static gboolean
proton_plus_cli_handler_uninstall_interactive_co (ProtonPlusCliHandlerUninstallInteractiveData* _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_cli_handler_get_installed_entries (_data_->self, _data_->runner);
	_data_->installed = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->installed;
	_data_->_tmp2_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_ == 0) {
		_data_->_tmp4_ = _data_->self->priv->output;
		_data_->_tmp5_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
		_data_->_tmp6_ = _data_->_tmp5_;
		proton_plus_cli_output_warning (_data_->_tmp4_, _ ("No installed releases found for %s\n"), _data_->_tmp6_, NULL);
		_data_->result = 0;
		_g_object_unref0 (_data_->installed);
		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_->self->priv->output;
	_data_->_tmp8_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
	_data_->_tmp9_ = _data_->_tmp8_;
	proton_plus_cli_output_header (_data_->_tmp7_, _ ("Installed releases for %s:\n"), _data_->_tmp9_, NULL);
	{
		_data_->i = 0;
		{
			_data_->_tmp10_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp10_) {
					_data_->_tmp11_ = _data_->i;
					_data_->i = _data_->_tmp11_ + 1;
				}
				_data_->_tmp10_ = FALSE;
				_data_->_tmp12_ = _data_->installed;
				_data_->_tmp13_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp12_);
				_data_->_tmp14_ = _data_->_tmp13_;
				if (!(_data_->i < _data_->_tmp14_)) {
					break;
				}
				_data_->_tmp15_ = _data_->self->priv->output;
				_data_->_tmp16_ = _data_->installed;
				_data_->_tmp17_ = gee_list_get (_data_->_tmp16_, _data_->i);
				_data_->_tmp18_ = (ProtonPlusModelsInstalledToolEntry*) _data_->_tmp17_;
				_data_->_tmp19_ = proton_plus_models_installed_tool_entry_get_display_title (_data_->_tmp18_);
				_data_->_tmp20_ = _data_->_tmp19_;
				proton_plus_cli_output_info (_data_->_tmp15_, "%d. %s\n", _data_->i + 1, _data_->_tmp20_, NULL);
				_g_object_unref0 (_data_->_tmp18_);
			}
		}
	}
	_data_->_tmp21_ = _data_->installed;
	_data_->_tmp22_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->index = proton_plus_cli_handler_read_user_selection (_data_->self, _ ("Select release number"), _data_->_tmp23_);
	if (_data_->index < 0) {
		_data_->result = 1;
		_g_object_unref0 (_data_->installed);
		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_ = _data_->installed;
	_data_->_tmp25_ = gee_list_get (_data_->_tmp24_, _data_->index);
	_data_->_tmp26_ = (ProtonPlusModelsInstalledToolEntry*) _data_->_tmp25_;
	_data_->_state_ = 1;
	proton_plus_cli_handler_uninstall_single_release (_data_->self, _data_->runner, _data_->_tmp26_, proton_plus_cli_handler_uninstall_interactive_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp27_ = proton_plus_cli_handler_uninstall_single_release_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->_tmp26_);
	_data_->result = _data_->_tmp27_;
	_g_object_unref0 (_data_->installed);
	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_cli_handler_uninstall_runner_all_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUninstallRunnerAllData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUninstallRunnerAllData, _data_);
}

static void
proton_plus_cli_handler_uninstall_runner_all (ProtonPlusCLIHandler* self,
                                              ProtonPlusModelsToolsProviderTool* runner,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallRunnerAllData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUninstallRunnerAllData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_uninstall_runner_all_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	proton_plus_cli_handler_uninstall_runner_all_co (_data_);
}

static gint
proton_plus_cli_handler_uninstall_runner_all_finish (ProtonPlusCLIHandler* self,
                                                     GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUninstallRunnerAllData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_uninstall_runner_all_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallRunnerAllData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_uninstall_runner_all_co (_data_);
}

static gboolean
proton_plus_cli_handler_uninstall_runner_all_co (ProtonPlusCliHandlerUninstallRunnerAllData* _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_cli_handler_get_installed_entries (_data_->self, _data_->runner);
	_data_->installed = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->installed;
	_data_->_tmp2_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_ == 0) {
		_data_->_tmp4_ = _data_->self->priv->output;
		_data_->_tmp5_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
		_data_->_tmp6_ = _data_->_tmp5_;
		proton_plus_cli_output_warning (_data_->_tmp4_, _ ("No installed releases found for %s\n"), _data_->_tmp6_, NULL);
		_data_->result = 0;
		_g_object_unref0 (_data_->installed);
		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_->self->priv->output;
	_data_->_tmp8_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
	_data_->_tmp9_ = _data_->_tmp8_;
	proton_plus_cli_output_info (_data_->_tmp7_, _ ("Uninstalling all releases for %s...\n"), _data_->_tmp9_, NULL);
	_data_->failed = FALSE;
	{
		_data_->_tmp10_ = _data_->installed;
		_data_->_entry_list = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->_entry_list;
		_data_->_tmp12_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_entry_size = _data_->_tmp13_;
		_data_->_entry_index = -1;
		while (TRUE) {
			_data_->_entry_index = _data_->_entry_index + 1;
			_data_->_tmp14_ = _data_->_entry_index;
			_data_->_tmp15_ = _data_->_entry_size;
			if (!(_data_->_tmp14_ < _data_->_tmp15_)) {
				break;
			}
			_data_->_tmp16_ = _data_->_entry_list;
			_data_->_tmp17_ = gee_list_get (_data_->_tmp16_, _data_->_entry_index);
			_data_->entry = (ProtonPlusModelsInstalledToolEntry*) _data_->_tmp17_;
			_data_->_tmp18_ = _data_->entry;
			_data_->_state_ = 1;
			proton_plus_cli_handler_uninstall_single_release (_data_->self, _data_->runner, _data_->_tmp18_, proton_plus_cli_handler_uninstall_runner_all_ready, _data_);
			return FALSE;
			_state_1:
			_data_->code = proton_plus_cli_handler_uninstall_single_release_finish (_data_->self, _data_->_res_);
			if (_data_->code != 0) {
				_data_->failed = TRUE;
			}
			_g_object_unref0 (_data_->entry);
		}
	}
	if (_data_->failed) {
		_data_->_tmp19_ = 1;
	} else {
		_data_->_tmp19_ = 0;
	}
	_data_->result = _data_->_tmp19_;
	_g_object_unref0 (_data_->installed);
	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_cli_handler_uninstall_launcher_all_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUninstallLauncherAllData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->launcher);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUninstallLauncherAllData, _data_);
}

static void
proton_plus_cli_handler_uninstall_launcher_all (ProtonPlusCLIHandler* self,
                                                ProtonPlusModelsLauncher* launcher,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallLauncherAllData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUninstallLauncherAllData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_uninstall_launcher_all_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (launcher);
	_g_object_unref0 (_data_->launcher);
	_data_->launcher = _tmp1_;
	proton_plus_cli_handler_uninstall_launcher_all_co (_data_);
}

static gint
proton_plus_cli_handler_uninstall_launcher_all_finish (ProtonPlusCLIHandler* self,
                                                       GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUninstallLauncherAllData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_uninstall_launcher_all_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallLauncherAllData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_uninstall_launcher_all_co (_data_);
}

static gboolean
proton_plus_cli_handler_uninstall_launcher_all_co (ProtonPlusCliHandlerUninstallLauncherAllData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->output;
	_data_->_tmp1_ = _data_->launcher->title;
	proton_plus_cli_output_info (_data_->_tmp0_, _ ("Uninstalling all releases for launcher %s...\n"), _data_->_tmp1_, NULL);
	_data_->failed = FALSE;
	_data_->_tmp2_ = _data_->launcher->groups;
	_data_->_tmp2__length1 = _data_->launcher->groups_length1;
	{
		_data_->group_collection_length1 = 0;
		_data_->_group_collection_size_ = 0;
		_data_->group_collection = _data_->_tmp2_;
		_data_->group_collection_length1 = _data_->_tmp2__length1;
		for (_data_->group_it = 0; _data_->group_it < _data_->group_collection_length1; _data_->group_it = _data_->group_it + 1) {
			_data_->_tmp3_ = _g_object_ref0 (_data_->group_collection[_data_->group_it]);
			_data_->group = _data_->_tmp3_;
			{
				{
					_data_->_tmp4_ = _data_->group;
					_data_->_tmp5_ = proton_plus_models_group_get_tools (_data_->_tmp4_);
					_data_->_tmp6_ = _data_->_tmp5_;
					_data_->_runner_list = _data_->_tmp6_;
					_data_->_tmp7_ = _data_->_runner_list;
					_data_->_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp7_);
					_data_->_tmp9_ = _data_->_tmp8_;
					_data_->_runner_size = _data_->_tmp9_;
					_data_->_runner_index = -1;
					while (TRUE) {
						_data_->_runner_index = _data_->_runner_index + 1;
						_data_->_tmp10_ = _data_->_runner_index;
						_data_->_tmp11_ = _data_->_runner_size;
						if (!(_data_->_tmp10_ < _data_->_tmp11_)) {
							break;
						}
						_data_->_tmp12_ = _data_->_runner_list;
						_data_->_tmp13_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp12_, _data_->_runner_index);
						_data_->runner = (ProtonPlusModelsTool*) _data_->_tmp13_;
						_data_->_tmp14_ = _data_->runner;
						_data_->_tmp15_ = _g_object_ref0 (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_data_->_tmp14_) ? ((ProtonPlusModelsToolsProviderTool*) _data_->_tmp14_) : NULL);
						_data_->provider_tool = _data_->_tmp15_;
						_data_->_tmp16_ = _data_->provider_tool;
						if (_data_->_tmp16_ == NULL) {
							_g_object_unref0 (_data_->provider_tool);
							_g_object_unref0 (_data_->runner);
							continue;
						}
						_data_->_tmp17_ = _data_->provider_tool;
						_data_->_tmp18_ = proton_plus_cli_handler_get_installed_entries (_data_->self, _data_->_tmp17_);
						_data_->installed = _data_->_tmp18_;
						{
							_data_->_tmp19_ = _data_->installed;
							_data_->_entry_list = _data_->_tmp19_;
							_data_->_tmp20_ = _data_->_entry_list;
							_data_->_tmp21_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp20_);
							_data_->_tmp22_ = _data_->_tmp21_;
							_data_->_entry_size = _data_->_tmp22_;
							_data_->_entry_index = -1;
							while (TRUE) {
								_data_->_entry_index = _data_->_entry_index + 1;
								_data_->_tmp23_ = _data_->_entry_index;
								_data_->_tmp24_ = _data_->_entry_size;
								if (!(_data_->_tmp23_ < _data_->_tmp24_)) {
									break;
								}
								_data_->_tmp25_ = _data_->_entry_list;
								_data_->_tmp26_ = gee_list_get (_data_->_tmp25_, _data_->_entry_index);
								_data_->entry = (ProtonPlusModelsInstalledToolEntry*) _data_->_tmp26_;
								_data_->_tmp27_ = _data_->provider_tool;
								_data_->_tmp28_ = _data_->entry;
								_data_->_state_ = 1;
								proton_plus_cli_handler_uninstall_single_release (_data_->self, _data_->_tmp27_, _data_->_tmp28_, proton_plus_cli_handler_uninstall_launcher_all_ready, _data_);
								return FALSE;
								_state_1:
								_data_->code = proton_plus_cli_handler_uninstall_single_release_finish (_data_->self, _data_->_res_);
								if (_data_->code != 0) {
									_data_->failed = TRUE;
								}
								_g_object_unref0 (_data_->entry);
							}
						}
						_g_object_unref0 (_data_->installed);
						_g_object_unref0 (_data_->provider_tool);
						_g_object_unref0 (_data_->runner);
					}
				}
				_g_object_unref0 (_data_->group);
			}
		}
	}
	if (_data_->failed) {
		_data_->_tmp29_ = 1;
	} else {
		_data_->_tmp29_ = 0;
	}
	_data_->result = _data_->_tmp29_;
	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_cli_handler_uninstall_single_release_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUninstallSingleReleaseData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_g_object_unref0 (_data_->entry);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUninstallSingleReleaseData, _data_);
}

static void
proton_plus_cli_handler_uninstall_single_release (ProtonPlusCLIHandler* self,
                                                  ProtonPlusModelsToolsProviderTool* runner,
                                                  ProtonPlusModelsInstalledToolEntry* entry,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallSingleReleaseData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	ProtonPlusModelsInstalledToolEntry* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	g_return_if_fail (entry != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUninstallSingleReleaseData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_uninstall_single_release_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	_tmp2_ = _g_object_ref0 (entry);
	_g_object_unref0 (_data_->entry);
	_data_->entry = _tmp2_;
	proton_plus_cli_handler_uninstall_single_release_co (_data_);
}

static gint
proton_plus_cli_handler_uninstall_single_release_finish (ProtonPlusCLIHandler* self,
                                                         GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUninstallSingleReleaseData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_uninstall_single_release_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_)
{
	ProtonPlusCliHandlerUninstallSingleReleaseData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_uninstall_single_release_co (_data_);
}

static gboolean
proton_plus_cli_handler_uninstall_single_release_co (ProtonPlusCliHandlerUninstallSingleReleaseData* _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_cli_handler_create_job (_data_->self, _data_->runner, _data_->entry);
	_data_->job = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->output;
	_data_->_tmp2_ = proton_plus_models_installed_tool_entry_get_display_title (_data_->entry);
	_data_->_tmp3_ = _data_->_tmp2_;
	proton_plus_cli_output_info (_data_->_tmp1_, _ ("Uninstalling %s...\n"), _data_->_tmp3_, NULL);
	_data_->_tmp4_ = _data_->job;
	_data_->_state_ = 1;
	proton_plus_services_install_job_remove (_data_->_tmp4_, FALSE, proton_plus_cli_handler_uninstall_single_release_ready, _data_);
	return FALSE;
	_state_1:
	_data_->code = proton_plus_services_install_job_remove_finish (_data_->_tmp4_, _data_->_res_);
	_data_->success = _data_->code == PROTON_PLUS_RETURN_CODE_RUNNER_REMOVED;
	if (_data_->success) {
		_data_->_tmp5_ = _data_->self->priv->output;
		_data_->_tmp6_ = proton_plus_models_installed_tool_entry_get_display_title (_data_->entry);
		_data_->_tmp7_ = _data_->_tmp6_;
		proton_plus_cli_output_success (_data_->_tmp5_, _ ("Successfully uninstalled %s\n"), _data_->_tmp7_, NULL);
	} else {
		_data_->_tmp8_ = _data_->self->priv->output;
		_data_->_tmp9_ = proton_plus_get_return_code_message (_data_->code);
		_data_->_tmp10_ = _data_->_tmp9_;
		proton_plus_cli_output_error (_data_->_tmp8_, _ ("Error: Uninstallation failed: %s\n"), _data_->_tmp10_, NULL);
		_g_free0 (_data_->_tmp10_);
	}
	if (_data_->success) {
		_data_->_tmp11_ = 0;
	} else {
		_data_->_tmp11_ = 1;
	}
	_data_->result = _data_->_tmp11_;
	_g_object_unref0 (_data_->job);
	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_cli_handler_update_all_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUpdateAllData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUpdateAllData, _data_);
}

static void
proton_plus_cli_handler_update_all (ProtonPlusCLIHandler* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateAllData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUpdateAllData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_update_all_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_cli_handler_update_all_co (_data_);
}

static gint
proton_plus_cli_handler_update_all_finish (ProtonPlusCLIHandler* self,
                                           GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUpdateAllData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_update_all_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateAllData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_update_all_co (_data_);
}

static gboolean
proton_plus_cli_handler_update_all_co (ProtonPlusCliHandlerUpdateAllData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->output;
	proton_plus_cli_output_info (_data_->_tmp0_, _ ("Updating all runners...\n"), NULL);
	_data_->_tmp1_ = _data_->self->priv->launchers;
	_data_->_tmp2_ = proton_plus_cli_handler_collect_latest_runners (_data_->self, _data_->_tmp1_);
	_data_->latest_runners = _data_->_tmp2_;
	_data_->_state_ = 1;
	proton_plus_cli_handler_update_runner_batch (_data_->self, _data_->latest_runners, proton_plus_cli_handler_update_all_ready, _data_);
	return FALSE;
	_state_1:
	_data_->result = proton_plus_cli_handler_update_runner_batch_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->latest_runners);
	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_cli_handler_update_launcher_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUpdateLauncherData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->launcher);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUpdateLauncherData, _data_);
}

static void
proton_plus_cli_handler_update_launcher (ProtonPlusCLIHandler* self,
                                         ProtonPlusModelsLauncher* launcher,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateLauncherData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUpdateLauncherData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_update_launcher_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (launcher);
	_g_object_unref0 (_data_->launcher);
	_data_->launcher = _tmp1_;
	proton_plus_cli_handler_update_launcher_co (_data_);
}

static gint
proton_plus_cli_handler_update_launcher_finish (ProtonPlusCLIHandler* self,
                                                GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUpdateLauncherData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_update_launcher_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateLauncherData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_update_launcher_co (_data_);
}

static gboolean
proton_plus_cli_handler_update_launcher_co (ProtonPlusCliHandlerUpdateLauncherData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->output;
	_data_->_tmp1_ = _data_->launcher->title;
	proton_plus_cli_output_info (_data_->_tmp0_, _ ("Updating runners for %s...\n"), _data_->_tmp1_, NULL);
	_data_->_tmp2_ = gee_linked_list_new (PROTON_PLUS_MODELS_TYPE_LAUNCHER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->scoped = _data_->_tmp2_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->scoped, _data_->launcher);
	_data_->_tmp3_ = proton_plus_cli_handler_collect_latest_runners (_data_->self, _data_->scoped);
	_data_->latest_runners = _data_->_tmp3_;
	_data_->_state_ = 1;
	proton_plus_cli_handler_update_runner_batch (_data_->self, _data_->latest_runners, proton_plus_cli_handler_update_launcher_ready, _data_);
	return FALSE;
	_state_1:
	_data_->result = proton_plus_cli_handler_update_runner_batch_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->latest_runners);
	_g_object_unref0 (_data_->scoped);
	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_cli_handler_update_runner_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUpdateRunnerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUpdateRunnerData, _data_);
}

static void
proton_plus_cli_handler_update_runner (ProtonPlusCLIHandler* self,
                                       ProtonPlusModelsToolsProviderTool* runner,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUpdateRunnerData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_update_runner_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	proton_plus_cli_handler_update_runner_co (_data_);
}

static gint
proton_plus_cli_handler_update_runner_finish (ProtonPlusCLIHandler* self,
                                              GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUpdateRunnerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_update_runner_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_update_runner_co (_data_);
}

static gboolean
proton_plus_cli_handler_update_runner_co (ProtonPlusCliHandlerUpdateRunnerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	proton_plus_cli_handler_update_runner_with_progress (_data_->self, _data_->runner, proton_plus_cli_handler_update_runner_ready, _data_);
	return FALSE;
	_state_1:
	_data_->code = proton_plus_cli_handler_update_runner_with_progress_finish (_data_->self, _data_->_res_);
	switch (_data_->code) {
		case PROTON_PLUS_RETURN_CODE_RUNNER_UPDATED:
		{
			_data_->_tmp0_ = _data_->self->priv->output;
			_data_->_tmp1_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
			_data_->_tmp2_ = _data_->_tmp1_;
			proton_plus_cli_output_success (_data_->_tmp0_, _ ("Successfully updated %s\n"), _data_->_tmp2_, NULL);
			_data_->result = 0;
			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_RETURN_CODE_NOTHING_TO_UPDATE:
		{
			_data_->_tmp3_ = _data_->self->priv->output;
			_data_->_tmp4_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
			_data_->_tmp5_ = _data_->_tmp4_;
			proton_plus_cli_output_success (_data_->_tmp3_, _ ("Already up to date: %s\n"), _data_->_tmp5_, NULL);
			_data_->result = 0;
			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_ = _data_->self->priv->output;
			_data_->_tmp7_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
			_data_->_tmp8_ = _data_->_tmp7_;
			_data_->_tmp9_ = proton_plus_get_return_code_message (_data_->code);
			_data_->_tmp10_ = _data_->_tmp9_;
			proton_plus_cli_output_error (_data_->_tmp6_, _ ("Error: Failed to update %s: %s\n"), _data_->_tmp8_, _data_->_tmp10_, NULL);
			_g_free0 (_data_->_tmp10_);
			_data_->result = 1;
			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 GeeLinkedList*
proton_plus_cli_handler_collect_latest_runners (ProtonPlusCLIHandler* self,
                                                GeeLinkedList* scope)
{
	GeeLinkedList* latest_runners = NULL;
	GeeLinkedList* _tmp0_;
	GeeHashSet* collected_runner_ids = NULL;
	GeeHashSet* _tmp1_;
	GeeLinkedList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (scope != NULL, NULL);
	_tmp0_ = gee_linked_list_new (PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	latest_runners = _tmp0_;
	_tmp1_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	collected_runner_ids = _tmp1_;
	{
		GeeLinkedList* _launcher_list = NULL;
		gint _launcher_size = 0;
		GeeLinkedList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _launcher_index = 0;
		_launcher_list = scope;
		_tmp2_ = _launcher_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_launcher_size = _tmp4_;
		_launcher_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusModelsLauncher* launcher = NULL;
			GeeLinkedList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusModelsLauncher* _tmp9_;
			ProtonPlusModelsGroup** _tmp10_;
			gint _tmp10__length1;
			_launcher_index = _launcher_index + 1;
			_tmp5_ = _launcher_index;
			_tmp6_ = _launcher_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _launcher_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _launcher_index);
			launcher = (ProtonPlusModelsLauncher*) _tmp8_;
			_tmp9_ = launcher;
			_tmp10_ = _tmp9_->groups;
			_tmp10__length1 = _tmp9_->groups_length1;
			{
				ProtonPlusModelsGroup** group_collection = NULL;
				gint group_collection_length1 = 0;
				gint _group_collection_size_ = 0;
				gint group_it = 0;
				group_collection = _tmp10_;
				group_collection_length1 = _tmp10__length1;
				for (group_it = 0; group_it < group_collection_length1; group_it = group_it + 1) {
					ProtonPlusModelsGroup* _tmp11_;
					ProtonPlusModelsGroup* group = NULL;
					_tmp11_ = _g_object_ref0 (group_collection[group_it]);
					group = _tmp11_;
					{
						ProtonPlusModelsGroup* _tmp12_;
						GeeList* entries = NULL;
						ProtonPlusModelsGroup* _tmp13_;
						GeeList* _tmp14_;
						_tmp12_ = group;
						proton_plus_models_group_refresh_installed_state (_tmp12_);
						_tmp13_ = group;
						_tmp14_ = proton_plus_models_group_get_installed_tool_snapshot (_tmp13_);
						entries = _tmp14_;
						{
							GeeLinkedList* _tool_list = NULL;
							ProtonPlusModelsGroup* _tmp15_;
							GeeLinkedList* _tmp16_;
							GeeLinkedList* _tmp17_;
							gint _tool_size = 0;
							GeeLinkedList* _tmp18_;
							gint _tmp19_;
							gint _tmp20_;
							gint _tool_index = 0;
							_tmp15_ = group;
							_tmp16_ = proton_plus_models_group_get_tools (_tmp15_);
							_tmp17_ = _tmp16_;
							_tool_list = _tmp17_;
							_tmp18_ = _tool_list;
							_tmp19_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp18_);
							_tmp20_ = _tmp19_;
							_tool_size = _tmp20_;
							_tool_index = -1;
							while (TRUE) {
								gint _tmp21_;
								gint _tmp22_;
								ProtonPlusModelsTool* tool = NULL;
								GeeLinkedList* _tmp23_;
								gpointer _tmp24_;
								ProtonPlusModelsToolsProviderTool* provider_tool = NULL;
								ProtonPlusModelsTool* _tmp25_;
								ProtonPlusModelsToolsProviderTool* _tmp26_;
								ProtonPlusModelsToolsProviderTool* _tmp27_;
								_tool_index = _tool_index + 1;
								_tmp21_ = _tool_index;
								_tmp22_ = _tool_size;
								if (!(_tmp21_ < _tmp22_)) {
									break;
								}
								_tmp23_ = _tool_list;
								_tmp24_ = gee_abstract_list_get ((GeeAbstractList*) _tmp23_, _tool_index);
								tool = (ProtonPlusModelsTool*) _tmp24_;
								_tmp25_ = tool;
								_tmp26_ = _g_object_ref0 (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_tmp25_) ? ((ProtonPlusModelsToolsProviderTool*) _tmp25_) : NULL);
								provider_tool = _tmp26_;
								_tmp27_ = provider_tool;
								if (_tmp27_ == NULL) {
									_g_object_unref0 (provider_tool);
									_g_object_unref0 (tool);
									continue;
								}
								{
									GeeList* _entry_list = NULL;
									GeeList* _tmp28_;
									gint _entry_size = 0;
									GeeList* _tmp29_;
									gint _tmp30_;
									gint _tmp31_;
									gint _entry_index = 0;
									_tmp28_ = entries;
									_entry_list = _tmp28_;
									_tmp29_ = _entry_list;
									_tmp30_ = gee_collection_get_size ((GeeCollection*) _tmp29_);
									_tmp31_ = _tmp30_;
									_entry_size = _tmp31_;
									_entry_index = -1;
									while (TRUE) {
										gint _tmp32_;
										gint _tmp33_;
										ProtonPlusModelsInstalledToolEntry* entry = NULL;
										GeeList* _tmp34_;
										gpointer _tmp35_;
										gchar* latest = NULL;
										ProtonPlusModelsTool* _tmp36_;
										const gchar* _tmp37_;
										const gchar* _tmp38_;
										gchar* _tmp39_;
										gchar* backup = NULL;
										const gchar* _tmp40_;
										gchar* _tmp41_;
										gboolean _tmp42_ = FALSE;
										gboolean _tmp43_ = FALSE;
										ProtonPlusModelsInstalledToolEntry* _tmp44_;
										const gchar* _tmp45_;
										const gchar* _tmp46_;
										const gchar* _tmp47_;
										_entry_index = _entry_index + 1;
										_tmp32_ = _entry_index;
										_tmp33_ = _entry_size;
										if (!(_tmp32_ < _tmp33_)) {
											break;
										}
										_tmp34_ = _entry_list;
										_tmp35_ = gee_list_get (_tmp34_, _entry_index);
										entry = (ProtonPlusModelsInstalledToolEntry*) _tmp35_;
										_tmp36_ = tool;
										_tmp37_ = proton_plus_models_tool_get_title (_tmp36_);
										_tmp38_ = _tmp37_;
										_tmp39_ = g_strdup_printf ("%s Latest", _tmp38_);
										latest = _tmp39_;
										_tmp40_ = latest;
										_tmp41_ = g_strdup_printf ("%s Backup", _tmp40_);
										backup = _tmp41_;
										_tmp44_ = entry;
										_tmp45_ = proton_plus_models_installed_tool_entry_get_directory_name (_tmp44_);
										_tmp46_ = _tmp45_;
										_tmp47_ = latest;
										if (g_strcmp0 (_tmp46_, _tmp47_) == 0) {
											_tmp43_ = TRUE;
										} else {
											ProtonPlusModelsInstalledToolEntry* _tmp48_;
											const gchar* _tmp49_;
											const gchar* _tmp50_;
											const gchar* _tmp51_;
											gchar* _tmp52_;
											gchar* _tmp53_;
											_tmp48_ = entry;
											_tmp49_ = proton_plus_models_installed_tool_entry_get_directory_name (_tmp48_);
											_tmp50_ = _tmp49_;
											_tmp51_ = latest;
											_tmp52_ = g_strdup_printf ("%s-", _tmp51_);
											_tmp53_ = _tmp52_;
											_tmp43_ = g_str_has_prefix (_tmp50_, _tmp53_);
											_g_free0 (_tmp53_);
										}
										if (_tmp43_) {
											_tmp42_ = TRUE;
										} else {
											ProtonPlusModelsInstalledToolEntry* _tmp54_;
											const gchar* _tmp55_;
											const gchar* _tmp56_;
											const gchar* _tmp57_;
											_tmp54_ = entry;
											_tmp55_ = proton_plus_models_installed_tool_entry_get_directory_name (_tmp54_);
											_tmp56_ = _tmp55_;
											_tmp57_ = backup;
											_tmp42_ = g_strcmp0 (_tmp56_, _tmp57_) == 0;
										}
										if (_tmp42_) {
											GeeHashSet* _tmp58_;
											ProtonPlusModelsToolsProviderTool* _tmp59_;
											const gchar* _tmp60_;
											const gchar* _tmp61_;
											_tmp58_ = collected_runner_ids;
											_tmp59_ = provider_tool;
											_tmp60_ = proton_plus_models_tool_get_id ((ProtonPlusModelsTool*) _tmp59_);
											_tmp61_ = _tmp60_;
											if (gee_abstract_collection_add ((GeeAbstractCollection*) _tmp58_, _tmp61_)) {
												GeeLinkedList* _tmp62_;
												ProtonPlusModelsToolsProviderTool* _tmp63_;
												_tmp62_ = latest_runners;
												_tmp63_ = provider_tool;
												gee_abstract_collection_add ((GeeAbstractCollection*) _tmp62_, _tmp63_);
											}
											_g_free0 (backup);
											_g_free0 (latest);
											_g_object_unref0 (entry);
											continue;
										}
										_g_free0 (backup);
										_g_free0 (latest);
										_g_object_unref0 (entry);
									}
								}
								_g_object_unref0 (provider_tool);
								_g_object_unref0 (tool);
							}
						}
						_g_object_unref0 (entries);
						_g_object_unref0 (group);
					}
				}
			}
			_g_object_unref0 (launcher);
		}
	}
	result = latest_runners;
	_g_object_unref0 (collected_runner_ids);
	return result;
}

static void
proton_plus_cli_handler_update_runner_batch_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUpdateRunnerBatchData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runners);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUpdateRunnerBatchData, _data_);
}

static void
proton_plus_cli_handler_update_runner_batch (ProtonPlusCLIHandler* self,
                                             GeeLinkedList* runners,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerBatchData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	GeeLinkedList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runners != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUpdateRunnerBatchData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_update_runner_batch_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runners);
	_g_object_unref0 (_data_->runners);
	_data_->runners = _tmp1_;
	proton_plus_cli_handler_update_runner_batch_co (_data_);
}

static gint
proton_plus_cli_handler_update_runner_batch_finish (ProtonPlusCLIHandler* self,
                                                    GAsyncResult* _res_)
{
	gint result;
	ProtonPlusCliHandlerUpdateRunnerBatchData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_update_runner_batch_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerBatchData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_update_runner_batch_co (_data_);
}

static gboolean
proton_plus_cli_handler_update_runner_batch_co (ProtonPlusCliHandlerUpdateRunnerBatchData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->runners);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ == 0) {
		_data_->_tmp2_ = _data_->self->priv->output;
		proton_plus_cli_output_success (_data_->_tmp2_, _ ("Already up to date\n"), NULL);
		_data_->result = 0;
		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_->failed = FALSE;
	{
		_data_->_runner_list = _data_->runners;
		_data_->_tmp3_ = _data_->_runner_list;
		_data_->_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_runner_size = _data_->_tmp5_;
		_data_->_runner_index = -1;
		while (TRUE) {
			_data_->_runner_index = _data_->_runner_index + 1;
			_data_->_tmp6_ = _data_->_runner_index;
			_data_->_tmp7_ = _data_->_runner_size;
			if (!(_data_->_tmp6_ < _data_->_tmp7_)) {
				break;
			}
			_data_->_tmp8_ = _data_->_runner_list;
			_data_->_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp8_, _data_->_runner_index);
			_data_->runner = (ProtonPlusModelsToolsProviderTool*) _data_->_tmp9_;
			_data_->_tmp10_ = _data_->runner;
			_data_->_state_ = 1;
			proton_plus_cli_handler_update_runner_with_progress (_data_->self, _data_->_tmp10_, proton_plus_cli_handler_update_runner_batch_ready, _data_);
			return FALSE;
			_state_1:
			_data_->code = proton_plus_cli_handler_update_runner_with_progress_finish (_data_->self, _data_->_res_);
			switch (_data_->code) {
				case PROTON_PLUS_RETURN_CODE_RUNNER_UPDATED:
				{
					_data_->_tmp11_ = _data_->self->priv->output;
					_data_->_tmp12_ = _data_->runner;
					_data_->_tmp13_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->_tmp12_);
					_data_->_tmp14_ = _data_->_tmp13_;
					proton_plus_cli_output_success (_data_->_tmp11_, _ ("Successfully updated %s\n"), _data_->_tmp14_, NULL);
					break;
				}
				case PROTON_PLUS_RETURN_CODE_NOTHING_TO_UPDATE:
				{
					_data_->_tmp15_ = _data_->self->priv->output;
					_data_->_tmp16_ = _data_->runner;
					_data_->_tmp17_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->_tmp16_);
					_data_->_tmp18_ = _data_->_tmp17_;
					proton_plus_cli_output_success (_data_->_tmp15_, _ ("Already up to date: %s\n"), _data_->_tmp18_, NULL);
					break;
				}
				default:
				{
					_data_->_tmp19_ = _data_->self->priv->output;
					_data_->_tmp20_ = _data_->runner;
					_data_->_tmp21_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->_tmp20_);
					_data_->_tmp22_ = _data_->_tmp21_;
					_data_->_tmp23_ = proton_plus_get_return_code_message (_data_->code);
					_data_->_tmp24_ = _data_->_tmp23_;
					proton_plus_cli_output_error (_data_->_tmp19_, _ ("Error: Failed to update %s: %s\n"), _data_->_tmp22_, _data_->_tmp24_, NULL);
					_g_free0 (_data_->_tmp24_);
					_data_->failed = TRUE;
					break;
				}
			}
			_g_object_unref0 (_data_->runner);
		}
	}
	if (_data_->failed) {
		_data_->_tmp25_ = 1;
	} else {
		_data_->_tmp25_ = 0;
	}
	_data_->result = _data_->_tmp25_;
	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_cli_handler_update_runner_with_progress_data_free (gpointer _data)
{
	ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerUpdateRunnerWithProgressData, _data_);
}

static void
proton_plus_cli_handler_update_runner_with_progress (ProtonPlusCLIHandler* self,
                                                     ProtonPlusModelsToolsProviderTool* runner,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerUpdateRunnerWithProgressData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_update_runner_with_progress_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	proton_plus_cli_handler_update_runner_with_progress_co (_data_);
}

static ProtonPlusReturnCode
proton_plus_cli_handler_update_runner_with_progress_finish (ProtonPlusCLIHandler* self,
                                                            GAsyncResult* _res_)
{
	ProtonPlusReturnCode result;
	ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_update_runner_with_progress_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_update_runner_with_progress_co (_data_);
}

static gboolean
proton_plus_cli_handler_update_runner_with_progress_co (ProtonPlusCliHandlerUpdateRunnerWithProgressData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->output;
	_data_->_tmp1_ = g_strconcat (_ ("Updating %s..."), "\r", NULL);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) _data_->runner);
	_data_->_tmp4_ = _data_->_tmp3_;
	proton_plus_cli_output_info (_data_->_tmp0_, _data_->_tmp2_, _data_->_tmp4_, NULL);
	_g_free0 (_data_->_tmp2_);
	_data_->_tmp5_ = _data_->self->priv->output;
	proton_plus_cli_output_flush_stdout (_data_->_tmp5_);
	_data_->_tmp6_ = proton_plus_services_installation_service_get_instance ();
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	proton_plus_services_installation_service_update_specific_runner (_data_->_tmp7_, _data_->runner, proton_plus_cli_handler_update_runner_with_progress_ready, _data_);
	return FALSE;
	_state_1:
	_data_->code = proton_plus_services_installation_service_update_specific_runner_finish (_data_->_tmp7_, _data_->_res_);
	_data_->_tmp8_ = _data_->self->priv->output;
	proton_plus_cli_output_info (_data_->_tmp8_, "\r\033[2K\r", NULL);
	_data_->result = _data_->code;
	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_cli_handler_load_launchers_data_free (gpointer _data)
{
	ProtonPlusCliHandlerLoadLaunchersData* _data_;
	_data_ = _data;
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerLoadLaunchersData, _data_);
}

static void
proton_plus_cli_handler_load_launchers (ProtonPlusCLIHandler* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusCliHandlerLoadLaunchersData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerLoadLaunchersData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_load_launchers_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_cli_handler_load_launchers_co (_data_);
}

static gboolean
proton_plus_cli_handler_load_launchers_finish (ProtonPlusCLIHandler* self,
                                               GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusCliHandlerLoadLaunchersData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_load_launchers_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ProtonPlusCliHandlerLoadLaunchersData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_load_launchers_co (_data_);
}

static gboolean
proton_plus_cli_handler_load_launchers_co (ProtonPlusCliHandlerLoadLaunchersData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->fixture_launchers;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->fixture_launchers;
		_data_->_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, GEE_TYPE_LINKED_LIST, GeeLinkedList));
		_g_object_unref0 (_data_->self->priv->launchers);
		_data_->self->priv->launchers = _data_->_tmp2_;
		_data_->result = TRUE;
		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_ = NULL;
	_data_->_state_ = 1;
	proton_plus_models_launcher_get_all (proton_plus_cli_handler_load_launchers_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = proton_plus_models_launcher_get_all_finish (_data_->_res_, &_data_->_tmp3_);
	_g_object_unref0 (_data_->self->priv->launchers);
	_data_->self->priv->launchers = _data_->_tmp3_;
	_data_->success = _data_->_tmp4_;
	if (!_data_->success) {
		_data_->_tmp5_ = TRUE;
	} else {
		_data_->_tmp6_ = _data_->self->priv->launchers;
		_data_->_tmp5_ = _data_->_tmp6_ == NULL;
	}
	if (_data_->_tmp5_) {
		_data_->_tmp7_ = _data_->self->priv->output;
		proton_plus_cli_output_error (_data_->_tmp7_, _ ("Error: Failed to load launchers\n"), NULL);
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = TRUE;
	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_cli_handler_load_runner_releases_data_free (gpointer _data)
{
	ProtonPlusCliHandlerLoadRunnerReleasesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->provider_tool);
	_proton_plus_cli_handler_unref0 (_data_->self);
	g_slice_free (ProtonPlusCliHandlerLoadRunnerReleasesData, _data_);
}

static void
proton_plus_cli_handler_load_runner_releases (ProtonPlusCLIHandler* self,
                                              ProtonPlusModelsToolsProviderTool* provider_tool,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	ProtonPlusCliHandlerLoadRunnerReleasesData* _data_;
	ProtonPlusCLIHandler* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (provider_tool != NULL);
	_data_ = g_slice_new0 (ProtonPlusCliHandlerLoadRunnerReleasesData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_cli_handler_load_runner_releases_data_free);
	_tmp0_ = _proton_plus_cli_handler_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (provider_tool);
	_g_object_unref0 (_data_->provider_tool);
	_data_->provider_tool = _tmp1_;
	proton_plus_cli_handler_load_runner_releases_co (_data_);
}

static ProtonPlusReturnCode
proton_plus_cli_handler_load_runner_releases_finish (ProtonPlusCLIHandler* self,
                                                     GAsyncResult* _res_)
{
	ProtonPlusReturnCode result;
	ProtonPlusCliHandlerLoadRunnerReleasesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_cli_handler_load_runner_releases_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	ProtonPlusCliHandlerLoadRunnerReleasesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_cli_handler_load_runner_releases_co (_data_);
}

static gboolean
proton_plus_cli_handler_load_runner_releases_co (ProtonPlusCliHandlerLoadRunnerReleasesData* _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_tool_get_release_catalog ((ProtonPlusModelsTool*) _data_->provider_tool);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->catalog = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->catalog;
	if (_data_->_tmp3_ == NULL) {
		_data_->result = PROTON_PLUS_RETURN_CODE_INVALID_CONFIGURATION;
		_g_object_unref0 (_data_->catalog);
		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_->_tmp4_ = _data_->catalog;
	_data_->_state_ = 1;
	proton_plus_models_release_catalog_load (_data_->_tmp4_, FALSE, proton_plus_cli_handler_load_runner_releases_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = proton_plus_models_release_catalog_load_finish (_data_->_tmp4_, _data_->_res_);
	_data_->_result_ = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->_result_;
	_data_->_tmp7_ = proton_plus_models_release_catalog_result_get_succeeded (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	if (!_data_->_tmp8_) {
		_data_->_tmp9_ = _data_->self->priv->output;
		_data_->_tmp10_ = _data_->_result_;
		_data_->_tmp11_ = proton_plus_models_release_catalog_result_get_code (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = proton_plus_get_return_code_message (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		proton_plus_cli_output_error (_data_->_tmp9_, _ ("Error: Failed to load releases: %s\n"), _data_->_tmp14_, NULL);
		_g_free0 (_data_->_tmp14_);
	} else {
		_data_->_tmp15_ = _data_->_result_;
		_data_->_tmp16_ = proton_plus_models_release_catalog_result_get_releases (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		if (_data_->_tmp19_ == 0) {
			_data_->_tmp20_ = _data_->self->priv->output;
			proton_plus_cli_output_error (_data_->_tmp20_, _ ("Error: No releases are available\n"), NULL);
		}
	}
	_data_->_tmp21_ = _data_->_result_;
	_data_->_tmp22_ = proton_plus_models_release_catalog_result_get_code (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->result = _data_->_tmp23_;
	_g_object_unref0 (_data_->_result_);
	_g_object_unref0 (_data_->catalog);
	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 ProtonPlusModelsLauncher*
proton_plus_cli_handler_find_launcher (ProtonPlusCLIHandler* self,
                                       const gchar* launcher_id)
{
	ProtonPlusCLIOutput* _tmp9_;
	ProtonPlusModelsLauncher* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (launcher_id != NULL, NULL);
	{
		GeeLinkedList* _launcher_list = NULL;
		GeeLinkedList* _tmp0_;
		gint _launcher_size = 0;
		GeeLinkedList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _launcher_index = 0;
		_tmp0_ = self->priv->launchers;
		_launcher_list = _tmp0_;
		_tmp1_ = _launcher_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_launcher_size = _tmp3_;
		_launcher_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			ProtonPlusModelsLauncher* launcher = NULL;
			GeeLinkedList* _tmp6_;
			gpointer _tmp7_;
			ProtonPlusModelsLauncher* _tmp8_;
			_launcher_index = _launcher_index + 1;
			_tmp4_ = _launcher_index;
			_tmp5_ = _launcher_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _launcher_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _launcher_index);
			launcher = (ProtonPlusModelsLauncher*) _tmp7_;
			_tmp8_ = launcher;
			if (proton_plus_cli_handler_matches_launcher_id (_tmp8_, launcher_id)) {
				result = launcher;
				return result;
			}
			_g_object_unref0 (launcher);
		}
	}
	_tmp9_ = self->priv->output;
	proton_plus_cli_output_error (_tmp9_, _ ("Error: Launcher '%s' not found\n"), launcher_id, NULL);
	proton_plus_cli_handler_print_available_launchers (self);
	result = NULL;
	return result;
}

static ProtonPlusModelsTool*
proton_plus_cli_handler_find_runner (ProtonPlusCLIHandler* self,
                                     ProtonPlusModelsLauncher* launcher,
                                     const gchar* runner_id)
{
	ProtonPlusModelsGroup** _tmp0_;
	gint _tmp0__length1;
	ProtonPlusCLIOutput* _tmp13_;
	ProtonPlusModelsTool* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (launcher != NULL, NULL);
	g_return_val_if_fail (runner_id != NULL, NULL);
	_tmp0_ = launcher->groups;
	_tmp0__length1 = launcher->groups_length1;
	{
		ProtonPlusModelsGroup** group_collection = NULL;
		gint group_collection_length1 = 0;
		gint _group_collection_size_ = 0;
		gint group_it = 0;
		group_collection = _tmp0_;
		group_collection_length1 = _tmp0__length1;
		for (group_it = 0; group_it < group_collection_length1; group_it = group_it + 1) {
			ProtonPlusModelsGroup* _tmp1_;
			ProtonPlusModelsGroup* group = NULL;
			_tmp1_ = _g_object_ref0 (group_collection[group_it]);
			group = _tmp1_;
			{
				{
					GeeLinkedList* _runner_list = NULL;
					ProtonPlusModelsGroup* _tmp2_;
					GeeLinkedList* _tmp3_;
					GeeLinkedList* _tmp4_;
					gint _runner_size = 0;
					GeeLinkedList* _tmp5_;
					gint _tmp6_;
					gint _tmp7_;
					gint _runner_index = 0;
					_tmp2_ = group;
					_tmp3_ = proton_plus_models_group_get_tools (_tmp2_);
					_tmp4_ = _tmp3_;
					_runner_list = _tmp4_;
					_tmp5_ = _runner_list;
					_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
					_tmp7_ = _tmp6_;
					_runner_size = _tmp7_;
					_runner_index = -1;
					while (TRUE) {
						gint _tmp8_;
						gint _tmp9_;
						ProtonPlusModelsTool* runner = NULL;
						GeeLinkedList* _tmp10_;
						gpointer _tmp11_;
						ProtonPlusModelsTool* _tmp12_;
						_runner_index = _runner_index + 1;
						_tmp8_ = _runner_index;
						_tmp9_ = _runner_size;
						if (!(_tmp8_ < _tmp9_)) {
							break;
						}
						_tmp10_ = _runner_list;
						_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _runner_index);
						runner = (ProtonPlusModelsTool*) _tmp11_;
						_tmp12_ = runner;
						if (proton_plus_cli_handler_matches_runner_id (_tmp12_, runner_id)) {
							result = runner;
							_g_object_unref0 (group);
							return result;
						}
						_g_object_unref0 (runner);
					}
				}
				_g_object_unref0 (group);
			}
		}
	}
	_tmp13_ = self->priv->output;
	proton_plus_cli_output_error (_tmp13_, _ ("Error: Tool '%s' not found\n"), runner_id, NULL);
	proton_plus_cli_handler_print_available_runners (self, launcher);
	result = NULL;
	return result;
}

static GeeList*
proton_plus_cli_handler_get_installed_entries (ProtonPlusCLIHandler* self,
                                               ProtonPlusModelsToolsProviderTool* runner)
{
	ProtonPlusModelsGroup* _tmp0_;
	ProtonPlusModelsGroup* _tmp1_;
	GeeList* entries = NULL;
	ProtonPlusModelsGroup* _tmp2_;
	ProtonPlusModelsGroup* _tmp3_;
	GeeList* _tmp4_;
	GeeArrayList* installed = NULL;
	GeeArrayList* _tmp5_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (runner != NULL, NULL);
	_tmp0_ = proton_plus_models_tool_get_group ((ProtonPlusModelsTool*) runner);
	_tmp1_ = _tmp0_;
	proton_plus_models_group_refresh_installed_state (_tmp1_);
	_tmp2_ = proton_plus_models_tool_get_group ((ProtonPlusModelsTool*) runner);
	_tmp3_ = _tmp2_;
	_tmp4_ = proton_plus_models_group_get_installed_tool_snapshot (_tmp3_);
	entries = _tmp4_;
	_tmp5_ = gee_array_list_new (PROTON_PLUS_MODELS_TYPE_INSTALLED_TOOL_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	installed = _tmp5_;
	{
		GeeList* _entry_list = NULL;
		GeeList* _tmp6_;
		gint _entry_size = 0;
		GeeList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _entry_index = 0;
		_tmp6_ = entries;
		_entry_list = _tmp6_;
		_tmp7_ = _entry_list;
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_entry_size = _tmp9_;
		_entry_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			ProtonPlusModelsInstalledToolEntry* entry = NULL;
			GeeList* _tmp12_;
			gpointer _tmp13_;
			gboolean _tmp14_ = FALSE;
			gboolean _tmp15_ = FALSE;
			ProtonPlusModelsInstalledToolEntry* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			const gchar* _tmp20_;
			_entry_index = _entry_index + 1;
			_tmp10_ = _entry_index;
			_tmp11_ = _entry_size;
			if (!(_tmp10_ < _tmp11_)) {
				break;
			}
			_tmp12_ = _entry_list;
			_tmp13_ = gee_list_get (_tmp12_, _entry_index);
			entry = (ProtonPlusModelsInstalledToolEntry*) _tmp13_;
			_tmp16_ = entry;
			_tmp17_ = proton_plus_models_installed_tool_entry_get_provider_id (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = proton_plus_models_tool_get_provider_id ((ProtonPlusModelsTool*) runner);
			_tmp20_ = _tmp19_;
			if (g_strcmp0 (_tmp18_, _tmp20_) == 0) {
				ProtonPlusModelsInstalledToolEntry* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				const gchar* _tmp25_;
				_tmp21_ = entry;
				_tmp22_ = proton_plus_models_installed_tool_entry_get_tool_id (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = proton_plus_models_tool_get_id ((ProtonPlusModelsTool*) runner);
				_tmp25_ = _tmp24_;
				_tmp15_ = g_strcmp0 (_tmp23_, _tmp25_) == 0;
			} else {
				_tmp15_ = FALSE;
			}
			if (_tmp15_) {
				ProtonPlusModelsInstalledToolEntry* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				ProtonPlusModelsGroup* _tmp29_;
				ProtonPlusModelsGroup* _tmp30_;
				ProtonPlusModelsLauncher* _tmp31_;
				ProtonPlusModelsLauncher* _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				_tmp26_ = entry;
				_tmp27_ = proton_plus_models_installed_tool_entry_get_launcher_id (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = proton_plus_models_tool_get_group ((ProtonPlusModelsTool*) runner);
				_tmp30_ = _tmp29_;
				_tmp31_ = proton_plus_models_group_get_launcher (_tmp30_);
				_tmp32_ = _tmp31_;
				_tmp33_ = proton_plus_models_launcher_get_tool_target_id (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp14_ = g_strcmp0 (_tmp28_, _tmp34_) == 0;
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				GeeArrayList* _tmp35_;
				ProtonPlusModelsInstalledToolEntry* _tmp36_;
				_tmp35_ = installed;
				_tmp36_ = entry;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp35_, _tmp36_);
			}
			_g_object_unref0 (entry);
		}
	}
	result = (GeeList*) installed;
	_g_object_unref0 (entries);
	return result;
}

gchar*
proton_plus_cli_handler_get_launcher_id (ProtonPlusModelsLauncher* launcher)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (launcher != NULL, NULL);
	_tmp0_ = proton_plus_models_launcher_get_instance_id (launcher);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	return result;
}

gchar*
proton_plus_cli_handler_get_runner_id (ProtonPlusModelsTool* runner)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (runner != NULL, NULL);
	_tmp0_ = proton_plus_models_tool_get_provider_id (runner);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	return result;
}

gboolean
proton_plus_cli_handler_matches_launcher_id (ProtonPlusModelsLauncher* launcher,
                                             const gchar* launcher_id)
{
	gboolean _tmp0_ = FALSE;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (launcher != NULL, FALSE);
	g_return_val_if_fail (launcher_id != NULL, FALSE);
	_tmp1_ = proton_plus_cli_handler_get_launcher_id (launcher);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, launcher_id) == 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = proton_plus_cli_handler_get_legacy_launcher_id (launcher);
		_tmp5_ = _tmp4_;
		_tmp0_ = g_strcmp0 (_tmp5_, launcher_id) == 0;
		_g_free0 (_tmp5_);
	}
	result = _tmp0_;
	return result;
}

gboolean
proton_plus_cli_handler_matches_runner_id (ProtonPlusModelsTool* runner,
                                           const gchar* runner_id)
{
	gboolean _tmp0_ = FALSE;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (runner != NULL, FALSE);
	g_return_val_if_fail (runner_id != NULL, FALSE);
	_tmp1_ = proton_plus_cli_handler_get_runner_id (runner);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, runner_id) == 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = proton_plus_cli_handler_get_legacy_runner_id (runner);
		_tmp5_ = _tmp4_;
		_tmp0_ = g_strcmp0 (_tmp5_, runner_id) == 0;
		_g_free0 (_tmp5_);
	}
	result = _tmp0_;
	return result;
}

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

static gchar*
proton_plus_cli_handler_get_legacy_launcher_id (ProtonPlusModelsLauncher* launcher)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* result;
	g_return_val_if_fail (launcher != NULL, NULL);
	_tmp0_ = launcher->title;
	_tmp1_ = g_utf8_strdown (_tmp0_, (gssize) -1);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_replace (_tmp2_, " ", "-");
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_models_launcher_get_installation_type_title (launcher);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_utf8_strdown (_tmp6_, (gssize) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strdup_printf ("%s-%s", _tmp4_, _tmp8_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	result = _tmp10_;
	return result;
}

static gchar*
proton_plus_cli_handler_get_legacy_runner_id (ProtonPlusModelsTool* runner)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (runner != NULL, NULL);
	_tmp0_ = proton_plus_models_tool_get_title (runner);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_replace (_tmp3_, " ", "-");
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	result = _tmp5_;
	return result;
}

static ProtonPlusServicesInstallJob*
proton_plus_cli_handler_create_job (ProtonPlusCLIHandler* self,
                                    ProtonPlusModelsToolsProviderTool* runner,
                                    ProtonPlusModelsInstalledToolEntry* entry)
{
	ProtonPlusModelsRelease* release = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ProtonPlusModelsAssetsAsset* _tmp2_;
	ProtonPlusModelsAssetsAsset* _tmp3_;
	gint64 _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	ProtonPlusModelsRelease* _tmp7_;
	ProtonPlusModelsRelease* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	ProtonPlusServicesInstallJob* _tmp11_;
	ProtonPlusServicesInstallJob* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (runner != NULL, NULL);
	g_return_val_if_fail (entry != NULL, NULL);
	_tmp0_ = proton_plus_models_installed_tool_entry_get_display_title (entry);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_assets_asset_new ("", "", (gint64) 0, "");
	_tmp3_ = _tmp2_;
	_tmp4_ = (gint64) 0;
	_tmp5_ = proton_plus_models_installed_tool_entry_get_release_id (entry);
	_tmp6_ = _tmp5_;
	_tmp7_ = proton_plus_models_release_new (_tmp1_, "", "", _tmp3_, "", &_tmp4_, "", _tmp6_, PROTON_PLUS_MODELS_RELEASE_KIND_GENERIC, "");
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp3_);
	release = _tmp8_;
	_tmp9_ = proton_plus_models_installed_tool_entry_get_path (entry);
	_tmp10_ = _tmp9_;
	_tmp11_ = proton_plus_cli_handler_create_install_job (self, release, runner, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_VERSIONED, _tmp10_);
	result = _tmp11_;
	_g_object_unref0 (release);
	return result;
}

static ProtonPlusServicesInstallJob*
proton_plus_cli_handler_real_create_install_job (ProtonPlusCLIHandler* self,
                                                 ProtonPlusModelsRelease* release,
                                                 ProtonPlusModelsToolsProviderTool* provider_tool,
                                                 ProtonPlusServicesInstallJobMode mode,
                                                 const gchar* installation_location)
{
	ProtonPlusServicesInstallJob* _tmp0_;
	ProtonPlusServicesInstallJob* result;
	g_return_val_if_fail (release != NULL, NULL);
	g_return_val_if_fail (provider_tool != NULL, NULL);
	_tmp0_ = proton_plus_services_install_job_new (release, (ProtonPlusModelsTool*) provider_tool, mode, installation_location, NULL);
	result = _tmp0_;
	return result;
}

ProtonPlusServicesInstallJob*
proton_plus_cli_handler_create_install_job (ProtonPlusCLIHandler* self,
                                            ProtonPlusModelsRelease* release,
                                            ProtonPlusModelsToolsProviderTool* provider_tool,
                                            ProtonPlusServicesInstallJobMode mode,
                                            const gchar* installation_location)
{
	ProtonPlusCLIHandlerClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PROTON_PLUS_CLI_HANDLER_GET_CLASS (self);
	if (_klass_->create_install_job) {
		return _klass_->create_install_job (self, release, provider_tool, mode, installation_location);
	}
	return NULL;
}

static ProtonPlusModelsToolsProviderTool*
proton_plus_cli_handler_get_provider_tool (ProtonPlusCLIHandler* self,
                                           ProtonPlusModelsTool* runner,
                                           const gchar* operation)
{
	ProtonPlusModelsToolsProviderTool* provider_tool = NULL;
	ProtonPlusModelsToolsProviderTool* _tmp0_;
	ProtonPlusModelsToolsProviderTool* _tmp1_;
	ProtonPlusModelsToolsProviderTool* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (runner != NULL, NULL);
	g_return_val_if_fail (operation != NULL, NULL);
	_tmp0_ = _g_object_ref0 (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (runner) ? ((ProtonPlusModelsToolsProviderTool*) runner) : NULL);
	provider_tool = _tmp0_;
	_tmp1_ = provider_tool;
	if (_tmp1_ == NULL) {
		ProtonPlusCLIOutput* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp2_ = self->priv->output;
		_tmp3_ = proton_plus_models_tool_get_title (runner);
		_tmp4_ = _tmp3_;
		proton_plus_cli_output_error (_tmp2_, _ ("Error: Tool '%s' does not support %s\n"), _tmp4_, operation, NULL);
	}
	result = provider_tool;
	return result;
}

static gboolean
proton_plus_cli_handler_validate_args (ProtonPlusCLIHandler* self,
                                       gchar** args,
                                       gint args_length1,
                                       gint min_required,
                                       const gchar* usage)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (usage != NULL, FALSE);
	if (args_length1 < min_required) {
		ProtonPlusCLIOutput* _tmp0_;
		_tmp0_ = self->priv->output;
		proton_plus_cli_output_error (_tmp0_, _ ("Usage: %s\n"), usage, NULL);
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

static gchar*
g_file_stream_read_line (FILE* self)
{
	gint c = 0;
	GString* ret = NULL;
	GString* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	ret = NULL;
	while (TRUE) {
		GString* _tmp0_;
		GString* _tmp2_;
		c = fgetc (self);
		if (!(c != EOF)) {
			break;
		}
		_tmp0_ = ret;
		if (_tmp0_ == NULL) {
			GString* _tmp1_;
			_tmp1_ = g_string_new ("");
			_g_string_free0 (ret);
			ret = _tmp1_;
		}
		if (c == ((gint) '\n')) {
			break;
		}
		_tmp2_ = ret;
		g_string_append_c ((GString*) _tmp2_, (gchar) c);
	}
	_tmp3_ = ret;
	if (_tmp3_ == NULL) {
		result = NULL;
		_g_string_free0 (ret);
		return result;
	} else {
		GString* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = ret;
		_tmp5_ = ((GString*) _tmp4_)->str;
		((GString*) _tmp4_)->str = NULL;
		result = _tmp5_;
		_g_string_free0 (ret);
		return result;
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gint
proton_plus_cli_handler_read_user_selection (ProtonPlusCLIHandler* self,
                                             const gchar* prompt,
                                             gint max)
{
	ProtonPlusCLIOutput* _tmp0_;
	ProtonPlusCLIOutput* _tmp1_;
	gchar* input = NULL;
	FILE* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp5_;
	gint val = 0;
	const gchar* _tmp9_;
	gboolean _tmp10_ = FALSE;
	gint index = 0;
	gboolean _tmp15_ = FALSE;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (prompt != NULL, -1);
	_tmp0_ = self->priv->output;
	proton_plus_cli_output_info (_tmp0_, "%s: ", prompt, NULL);
	_tmp1_ = self->priv->output;
	proton_plus_cli_output_flush_stdout (_tmp1_);
	_tmp2_ = stdin;
	_tmp3_ = g_file_stream_read_line (_tmp2_);
	input = _tmp3_;
	_tmp5_ = input;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp6_ = input;
		_tmp7_ = string_strip (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = g_strcmp0 (_tmp8_, "") == 0;
		_g_free0 (_tmp8_);
	}
	if (_tmp4_) {
		result = -1;
		_g_free0 (input);
		return result;
	}
	_tmp9_ = input;
	val = atoi (_tmp9_);
	if (val == 0) {
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp11_ = input;
		_tmp12_ = string_strip (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp10_ = g_strcmp0 (_tmp13_, "0") != 0;
		_g_free0 (_tmp13_);
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		ProtonPlusCLIOutput* _tmp14_;
		_tmp14_ = self->priv->output;
		proton_plus_cli_output_error (_tmp14_, _ ("Error: Invalid input, please enter a number\n"), NULL);
		result = -1;
		_g_free0 (input);
		return result;
	}
	index = val - 1;
	if (index < 0) {
		_tmp15_ = TRUE;
	} else {
		_tmp15_ = index >= max;
	}
	if (_tmp15_) {
		ProtonPlusCLIOutput* _tmp16_;
		_tmp16_ = self->priv->output;
		proton_plus_cli_output_error (_tmp16_, _ ("Error: Selection out of range\n"), NULL);
		result = -1;
		_g_free0 (input);
		return result;
	}
	result = index;
	_g_free0 (input);
	return result;
}

static void
proton_plus_cli_handler_print_usage (ProtonPlusCLIHandler* self)
{
	ProtonPlusCLIOutput* _tmp0_;
	ProtonPlusCLIOutput* _tmp1_;
	ProtonPlusCLIOutput* _tmp2_;
	ProtonPlusCLIOutput* _tmp3_;
	ProtonPlusCLIOutput* _tmp4_;
	ProtonPlusCLIOutput* _tmp5_;
	ProtonPlusCLIOutput* _tmp6_;
	ProtonPlusCLIOutput* _tmp7_;
	ProtonPlusCLIOutput* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->output;
	proton_plus_cli_output_header (_tmp0_, _ ("Usage:\n"), NULL);
	_tmp1_ = self->priv->output;
	proton_plus_cli_output_info (_tmp1_, "  protonplus <command> [options]\n\n", NULL);
	_tmp2_ = self->priv->output;
	proton_plus_cli_output_header (_tmp2_, _ ("Commands:\n"), NULL);
	_tmp3_ = self->priv->output;
	proton_plus_cli_output_info (_tmp3_, "  %-45s %s\n", "version", _ ("Show version"), NULL);
	_tmp4_ = self->priv->output;
	proton_plus_cli_output_info (_tmp4_, "  %-45s %s\n", "help", _ ("Show this help"), NULL);
	_tmp5_ = self->priv->output;
	proton_plus_cli_output_info (_tmp5_, "  %-45s %s\n", "list [launcher_id]", _ ("List launchers or installed runners"), NULL);
	_tmp6_ = self->priv->output;
	proton_plus_cli_output_info (_tmp6_, "  %-45s %s\n", "install <launcher_id> <runner_id> [latest]", _ ("Install runner"), NULL);
	_tmp7_ = self->priv->output;
	proton_plus_cli_output_info (_tmp7_, "  %-45s %s\n", "uninstall <launcher_id> <runner_id|all> [all]", _ ("Uninstall runner"), NULL);
	_tmp8_ = self->priv->output;
	proton_plus_cli_output_info (_tmp8_, "  %-45s %s\n", "update <all|launcher_id> [runner_id]", _ ("Update runner"), NULL);
}

static void
proton_plus_cli_handler_print_available_launchers (ProtonPlusCLIHandler* self)
{
	ProtonPlusCLIOutput* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->output;
	proton_plus_cli_output_header (_tmp0_, _ ("\nAvailable launchers:\n"), NULL);
	{
		GeeLinkedList* _launcher_list = NULL;
		GeeLinkedList* _tmp1_;
		gint _launcher_size = 0;
		GeeLinkedList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _launcher_index = 0;
		_tmp1_ = self->priv->launchers;
		_launcher_list = _tmp1_;
		_tmp2_ = _launcher_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_launcher_size = _tmp4_;
		_launcher_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusModelsLauncher* launcher = NULL;
			GeeLinkedList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusCLIOutput* _tmp9_;
			ProtonPlusModelsLauncher* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			ProtonPlusModelsLauncher* _tmp13_;
			const gchar* _tmp14_;
			_launcher_index = _launcher_index + 1;
			_tmp5_ = _launcher_index;
			_tmp6_ = _launcher_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _launcher_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _launcher_index);
			launcher = (ProtonPlusModelsLauncher*) _tmp8_;
			_tmp9_ = self->priv->output;
			_tmp10_ = launcher;
			_tmp11_ = proton_plus_cli_handler_get_launcher_id (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = launcher;
			_tmp14_ = _tmp13_->title;
			proton_plus_cli_output_info (_tmp9_, "  %-45s (%s)\n", _tmp12_, _tmp14_, NULL);
			_g_free0 (_tmp12_);
			_g_object_unref0 (launcher);
		}
	}
}

static void
proton_plus_cli_handler_print_available_runners (ProtonPlusCLIHandler* self,
                                                 ProtonPlusModelsLauncher* launcher)
{
	ProtonPlusCLIOutput* _tmp0_;
	const gchar* _tmp1_;
	ProtonPlusModelsGroup** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_tmp0_ = self->priv->output;
	_tmp1_ = launcher->title;
	proton_plus_cli_output_header (_tmp0_, _ ("\nAvailable runners for %s:\n"), _tmp1_, NULL);
	_tmp2_ = launcher->groups;
	_tmp2__length1 = launcher->groups_length1;
	{
		ProtonPlusModelsGroup** group_collection = NULL;
		gint group_collection_length1 = 0;
		gint _group_collection_size_ = 0;
		gint group_it = 0;
		group_collection = _tmp2_;
		group_collection_length1 = _tmp2__length1;
		for (group_it = 0; group_it < group_collection_length1; group_it = group_it + 1) {
			ProtonPlusModelsGroup* _tmp3_;
			ProtonPlusModelsGroup* group = NULL;
			_tmp3_ = _g_object_ref0 (group_collection[group_it]);
			group = _tmp3_;
			{
				{
					GeeLinkedList* _runner_list = NULL;
					ProtonPlusModelsGroup* _tmp4_;
					GeeLinkedList* _tmp5_;
					GeeLinkedList* _tmp6_;
					gint _runner_size = 0;
					GeeLinkedList* _tmp7_;
					gint _tmp8_;
					gint _tmp9_;
					gint _runner_index = 0;
					_tmp4_ = group;
					_tmp5_ = proton_plus_models_group_get_tools (_tmp4_);
					_tmp6_ = _tmp5_;
					_runner_list = _tmp6_;
					_tmp7_ = _runner_list;
					_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp7_);
					_tmp9_ = _tmp8_;
					_runner_size = _tmp9_;
					_runner_index = -1;
					while (TRUE) {
						gint _tmp10_;
						gint _tmp11_;
						ProtonPlusModelsTool* runner = NULL;
						GeeLinkedList* _tmp12_;
						gpointer _tmp13_;
						ProtonPlusCLIOutput* _tmp14_;
						ProtonPlusModelsTool* _tmp15_;
						gchar* _tmp16_;
						gchar* _tmp17_;
						ProtonPlusModelsTool* _tmp18_;
						const gchar* _tmp19_;
						const gchar* _tmp20_;
						_runner_index = _runner_index + 1;
						_tmp10_ = _runner_index;
						_tmp11_ = _runner_size;
						if (!(_tmp10_ < _tmp11_)) {
							break;
						}
						_tmp12_ = _runner_list;
						_tmp13_ = gee_abstract_list_get ((GeeAbstractList*) _tmp12_, _runner_index);
						runner = (ProtonPlusModelsTool*) _tmp13_;
						_tmp14_ = self->priv->output;
						_tmp15_ = runner;
						_tmp16_ = proton_plus_cli_handler_get_runner_id (_tmp15_);
						_tmp17_ = _tmp16_;
						_tmp18_ = runner;
						_tmp19_ = proton_plus_models_tool_get_title (_tmp18_);
						_tmp20_ = _tmp19_;
						proton_plus_cli_output_info (_tmp14_, "  %-45s (%s)\n", _tmp17_, _tmp20_, NULL);
						_g_free0 (_tmp17_);
						_g_object_unref0 (runner);
					}
				}
				_g_object_unref0 (group);
			}
		}
	}
}

static void
proton_plus_cli_handler_on_progress_updated (ProtonPlusCLIHandler* self,
                                             ProtonPlusServicesInstallJob* job)
{
	gchar* speed = NULL;
	gdouble _tmp0_;
	gdouble _tmp1_;
	gchar* _tmp2_;
	gchar* progress = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* eta_text = NULL;
	gdouble _tmp6_;
	gdouble _tmp7_;
	const gchar* _tmp14_ = NULL;
	ProtonPlusServicesInstallJobState _tmp15_;
	ProtonPlusServicesInstallJobState _tmp16_;
	gchar* label = NULL;
	gchar* _tmp17_;
	ProtonPlusCLIOutput* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	ProtonPlusCLIOutput* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	_tmp0_ = proton_plus_services_install_job_get_speed_kbps (job);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_utils_filesystem_convert_bytes_to_string ((gint64) (_tmp1_ * 1024));
	speed = _tmp2_;
	_tmp3_ = proton_plus_services_install_job_get_progress (job);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup (_tmp4_);
	progress = _tmp5_;
	_tmp6_ = proton_plus_services_install_job_get_seconds_remaining (job);
	_tmp7_ = _tmp6_;
	if (_tmp7_ >= ((gdouble) 0)) {
		gdouble _tmp8_;
		gdouble _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp8_ = proton_plus_services_install_job_get_seconds_remaining (job);
		_tmp9_ = _tmp8_;
		_tmp10_ = proton_plus_cli_handler_format_time (self, _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strdup_printf (_ ("ETA: %s"), _tmp11_);
		_g_free0 (eta_text);
		eta_text = _tmp12_;
		_g_free0 (_tmp11_);
	} else {
		gchar* _tmp13_;
		_tmp13_ = g_strdup (_ ("ETA: --"));
		_g_free0 (eta_text);
		eta_text = _tmp13_;
	}
	_tmp15_ = proton_plus_services_install_job_get_state (job);
	_tmp16_ = _tmp15_;
	if (_tmp16_ == PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_BUSY_UPDATING) {
		_tmp14_ = _ ("Updating");
	} else {
		_tmp14_ = _ ("Installing");
	}
	_tmp17_ = g_strdup (_tmp14_);
	label = _tmp17_;
	_tmp18_ = self->priv->output;
	_tmp19_ = proton_plus_services_install_job_get_title (job);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp22_ = progress;
	_tmp23_ = speed;
	_tmp24_ = eta_text;
	proton_plus_cli_output_info (_tmp18_, "\r\033[2K%s %s... %s (%s/s) [%s]\r", label, _tmp21_, _tmp22_, _tmp23_, _tmp24_, NULL);
	_g_free0 (_tmp21_);
	_tmp25_ = self->priv->output;
	proton_plus_cli_output_flush_stdout (_tmp25_);
	_g_free0 (label);
	_g_free0 (eta_text);
	_g_free0 (progress);
	_g_free0 (speed);
}

static gchar*
proton_plus_cli_handler_format_time (ProtonPlusCLIHandler* self,
                                     gdouble seconds)
{
	gint total_seconds = 0;
	gint h = 0;
	gint m = 0;
	gint s = 0;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	total_seconds = (gint) seconds;
	h = total_seconds / 3600;
	m = (total_seconds % 3600) / 60;
	s = total_seconds % 60;
	if (h > 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup_printf (_ ("%dh %dm %ds"), h, m, s);
		result = _tmp0_;
		return result;
	} else {
		if (m > 0) {
			gchar* _tmp1_;
			_tmp1_ = g_strdup_printf (_ ("%dm %ds"), m, s);
			result = _tmp1_;
			return result;
		} else {
			gchar* _tmp2_;
			_tmp2_ = g_strdup_printf (_ ("%ds"), s);
			result = _tmp2_;
			return result;
		}
	}
}

ProtonPlusCLICliOutputSink*
proton_plus_cli_handler_get_output_sink (ProtonPlusCLIHandler* self)
{
	ProtonPlusCLICliOutputSink* result;
	ProtonPlusCLICliOutputSink* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_output_sink;
	result = _tmp0_;
	return result;
}

static void
proton_plus_cli_handler_set_output_sink (ProtonPlusCLIHandler* self,
                                         ProtonPlusCLICliOutputSink* value)
{
	ProtonPlusCLICliOutputSink* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_output_sink);
	self->priv->_output_sink = _tmp0_;
}

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

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

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

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

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

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

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

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

void
proton_plus_cli_value_set_handler (GValue* value,
                                   gpointer v_object)
{
	ProtonPlusCLIHandler * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_CLI_TYPE_HANDLER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_CLI_TYPE_HANDLER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		proton_plus_cli_handler_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_cli_handler_unref (old);
	}
}

void
proton_plus_cli_value_take_handler (GValue* value,
                                    gpointer v_object)
{
	ProtonPlusCLIHandler * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_CLI_TYPE_HANDLER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_CLI_TYPE_HANDLER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_cli_handler_unref (old);
	}
}

static void
proton_plus_cli_handler_class_init (ProtonPlusCLIHandlerClass * klass,
                                    gpointer klass_data)
{
	proton_plus_cli_handler_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusCLIHandlerClass *) klass)->finalize = proton_plus_cli_handler_finalize;
	g_type_class_adjust_private_offset (klass, &ProtonPlusCLIHandler_private_offset);
	((ProtonPlusCLIHandlerClass *) klass)->create_install_job = (ProtonPlusServicesInstallJob* (*) (ProtonPlusCLIHandler*, ProtonPlusModelsRelease*, ProtonPlusModelsToolsProviderTool*, ProtonPlusServicesInstallJobMode, const gchar*)) proton_plus_cli_handler_real_create_install_job;
}

static void
proton_plus_cli_handler_instance_init (ProtonPlusCLIHandler * self,
                                       gpointer klass)
{
	self->priv = proton_plus_cli_handler_get_instance_private (self);
	self->priv->progress_updated_handler_id = (gulong) 0;
	self->priv->steam_restart_recording_failed_handler_id = (gulong) 0;
	self->ref_count = 1;
}

static void
proton_plus_cli_handler_finalize (ProtonPlusCLIHandler * obj)
{
	ProtonPlusCLIHandler * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_CLI_TYPE_HANDLER, ProtonPlusCLIHandler);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->launchers);
	_g_object_unref0 (self->priv->fixture_launchers);
	_proton_plus_cli_output_unref0 (self->priv->output);
	_g_object_unref0 (self->priv->_output_sink);
}

static GType
proton_plus_cli_handler_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { proton_plus_cli_value_handler_init, proton_plus_cli_value_handler_free_value, proton_plus_cli_value_handler_copy_value, proton_plus_cli_value_handler_peek_pointer, "p", proton_plus_cli_value_handler_collect_value, "p", proton_plus_cli_value_handler_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusCLIHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_cli_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusCLIHandler), 0, (GInstanceInitFunc) proton_plus_cli_handler_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType proton_plus_cli_handler_type_id;
	proton_plus_cli_handler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ProtonPlusCLIHandler", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ProtonPlusCLIHandler_private_offset = g_type_add_instance_private (proton_plus_cli_handler_type_id, sizeof (ProtonPlusCLIHandlerPrivate));
	return proton_plus_cli_handler_type_id;
}

GType
proton_plus_cli_handler_get_type (void)
{
	static volatile gsize proton_plus_cli_handler_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_cli_handler_type_id__once)) {
		GType proton_plus_cli_handler_type_id;
		proton_plus_cli_handler_type_id = proton_plus_cli_handler_get_type_once ();
		g_once_init_leave (&proton_plus_cli_handler_type_id__once, proton_plus_cli_handler_type_id);
	}
	return proton_plus_cli_handler_type_id__once;
}

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

void
proton_plus_cli_handler_unref (gpointer instance)
{
	ProtonPlusCLIHandler * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PROTON_PLUS_CLI_HANDLER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

