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

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define PROTON_PLUS_UTILS_TYPE_SYSTEM (proton_plus_utils_system_get_type ())
#define PROTON_PLUS_UTILS_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_UTILS_TYPE_SYSTEM, ProtonPlusUtilsSystem))
#define PROTON_PLUS_UTILS_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_UTILS_TYPE_SYSTEM, ProtonPlusUtilsSystemClass))
#define PROTON_PLUS_UTILS_IS_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_UTILS_TYPE_SYSTEM))
#define PROTON_PLUS_UTILS_IS_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_UTILS_TYPE_SYSTEM))
#define PROTON_PLUS_UTILS_SYSTEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_UTILS_TYPE_SYSTEM, ProtonPlusUtilsSystemClass))

typedef struct _ProtonPlusUtilsSystem ProtonPlusUtilsSystem;
typedef struct _ProtonPlusUtilsSystemClass ProtonPlusUtilsSystemClass;
typedef struct _ProtonPlusUtilsSystemPrivate ProtonPlusUtilsSystemPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ProtonPlusUtilsSystemRunCommandData ProtonPlusUtilsSystemRunCommandData;
typedef struct _ProtonPlusUtilsSystemCheckDependencyData ProtonPlusUtilsSystemCheckDependencyData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _ProtonPlusUtilsSystemGetDistributionNameData ProtonPlusUtilsSystemGetDistributionNameData;
typedef struct _ProtonPlusUtilsSystemGetProtontricksExecData ProtonPlusUtilsSystemGetProtontricksExecData;
typedef struct _ProtonPlusUtilsParamSpecSystem ProtonPlusUtilsParamSpecSystem;

struct _ProtonPlusUtilsSystem {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ProtonPlusUtilsSystemPrivate * priv;
};

struct _ProtonPlusUtilsSystemClass {
	GTypeClass parent_class;
	void (*finalize) (ProtonPlusUtilsSystem *self);
};

struct _ProtonPlusUtilsSystemRunCommandData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* command;
	gchar* result;
	gchar* output;
	gchar* _tmp0_;
	gchar* command_line;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** argv;
	gint argv_length1;
	gint _argv_size_;
	const gchar* _tmp6_;
	gchar** _tmp7_;
	gint _tmp8_;
	GSubprocess* subprocess;
	gchar** _tmp9_;
	gint _tmp9__length1;
	GSubprocess* _tmp10_;
	GBytes* stdout_bytes;
	GSubprocess* _tmp11_;
	GBytes* _tmp12_;
	GBytes* _tmp13_;
	guint8* data;
	GBytes* _tmp14_;
	gsize _tmp15_;
	guint8* _tmp16_;
	gint data_length1;
	gint _data_size_;
	gchar* str_data;
	guint8* _tmp17_;
	gint _tmp17__length1;
	gchar* _tmp18_;
	gint str_data_length1;
	gint _str_data_size_;
	gchar* _tmp19_;
	gint _tmp19__length1;
	guint8* _tmp20_;
	gint _tmp20__length1;
	guint8* _tmp21_;
	gint _tmp21__length1;
	gchar* _tmp22_;
	gint _tmp22__length1;
	guint8* _tmp23_;
	gint _tmp23__length1;
	gchar* _tmp24_;
	gint _tmp24__length1;
	gchar* _tmp25_;
	GError* e;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError* _inner_error0_;
};

struct _ProtonPlusUtilsSystemCheckDependencyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* name;
	gboolean result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
};

struct _ProtonPlusUtilsSystemGetDistributionNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* result;
	gchar* distro_name;
	gchar* _tmp0_;
	GFile* file;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GFileInputStream* _tmp5_;
	GFile* _tmp6_;
	GFileInputStream* _tmp7_;
	GDataInputStream* dis;
	GDataInputStream* _tmp8_;
	gchar* line;
	gchar* _tmp9_;
	GDataInputStream* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GError* e;
	GError* _tmp21_;
	const gchar* _tmp22_;
	GError* _inner_error0_;
};

struct _ProtonPlusUtilsSystemGetProtontricksExecData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* result;
	gchar** protontricks_execs;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint protontricks_execs_length1;
	gint _protontricks_execs_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** protontricks_exec_collection;
	gint protontricks_exec_collection_length1;
	gint _protontricks_exec_collection_size_;
	gint protontricks_exec_it;
	gchar* _tmp4_;
	gchar* protontricks_exec;
	const gchar* _tmp5_;
};

struct _ProtonPlusUtilsParamSpecSystem {
	GParamSpec parent_instance;
};

static gpointer proton_plus_utils_system_parent_class = NULL;
VALA_EXTERN gboolean proton_plus_globals_IS_FLATPAK;

VALA_EXTERN gpointer proton_plus_utils_system_ref (gpointer instance);
VALA_EXTERN void proton_plus_utils_system_unref (gpointer instance);
VALA_EXTERN GParamSpec* proton_plus_utils_param_spec_system (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags);
VALA_EXTERN void proton_plus_utils_value_set_system (GValue* value,
                                         gpointer v_object);
VALA_EXTERN void proton_plus_utils_value_take_system (GValue* value,
                                          gpointer v_object);
VALA_EXTERN gpointer proton_plus_utils_value_get_system (const GValue* value);
VALA_EXTERN GType proton_plus_utils_system_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusUtilsSystem, proton_plus_utils_system_unref)
static void proton_plus_utils_system_run_command_data_free (gpointer _data);
VALA_EXTERN void proton_plus_utils_system_run_command (const gchar* command,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN gchar* proton_plus_utils_system_run_command_finish (GAsyncResult* _res_);
static gboolean proton_plus_utils_system_run_command_co (ProtonPlusUtilsSystemRunCommandData* _data_);
static void proton_plus_utils_system_run_command_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
VALA_EXTERN GList* proton_plus_utils_system_get_hwcaps (void);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static void proton_plus_utils_system_check_dependency_data_free (gpointer _data);
VALA_EXTERN void proton_plus_utils_system_check_dependency (const gchar* name,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN gboolean proton_plus_utils_system_check_dependency_finish (GAsyncResult* _res_);
static gboolean proton_plus_utils_system_check_dependency_co (ProtonPlusUtilsSystemCheckDependencyData* _data_);
static void proton_plus_utils_system_check_dependency_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void proton_plus_utils_system_get_distribution_name_data_free (gpointer _data);
VALA_EXTERN void proton_plus_utils_system_get_distribution_name (GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN gchar* proton_plus_utils_system_get_distribution_name_finish (GAsyncResult* _res_);
static gboolean proton_plus_utils_system_get_distribution_name_co (ProtonPlusUtilsSystemGetDistributionNameData* _data_);
VALA_EXTERN void proton_plus_utils_system_open_uri (const gchar* uri);
static void __lambda11_ (GObject* obj,
                  GAsyncResult* res);
static void ___lambda11__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void proton_plus_utils_system_get_protontricks_exec_data_free (gpointer _data);
VALA_EXTERN void proton_plus_utils_system_get_protontricks_exec (GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN gchar* proton_plus_utils_system_get_protontricks_exec_finish (GAsyncResult* _res_);
static gboolean proton_plus_utils_system_get_protontricks_exec_co (ProtonPlusUtilsSystemGetProtontricksExecData* _data_);
static void proton_plus_utils_system_get_protontricks_exec_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
VALA_EXTERN ProtonPlusUtilsSystem* proton_plus_utils_system_new (void);
VALA_EXTERN ProtonPlusUtilsSystem* proton_plus_utils_system_construct (GType object_type);
static void proton_plus_utils_system_finalize (ProtonPlusUtilsSystem * obj);
static GType proton_plus_utils_system_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
proton_plus_utils_system_run_command_data_free (gpointer _data)
{
	ProtonPlusUtilsSystemRunCommandData* _data_;
	_data_ = _data;
	_g_free0 (_data_->command);
	_g_free0 (_data_->result);
	g_slice_free (ProtonPlusUtilsSystemRunCommandData, _data_);
}

void
proton_plus_utils_system_run_command (const gchar* command,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	ProtonPlusUtilsSystemRunCommandData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (command != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsSystemRunCommandData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_system_run_command_data_free);
	_tmp0_ = g_strdup (command);
	_g_free0 (_data_->command);
	_data_->command = _tmp0_;
	proton_plus_utils_system_run_command_co (_data_);
}

gchar*
proton_plus_utils_system_run_command_finish (GAsyncResult* _res_)
{
	gchar* result;
	ProtonPlusUtilsSystemRunCommandData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_utils_system_run_command_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	ProtonPlusUtilsSystemRunCommandData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_system_run_command_co (_data_);
}

static gboolean
proton_plus_utils_system_run_command_co (ProtonPlusUtilsSystemRunCommandData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("");
	_data_->output = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_strdup ("");
		_data_->command_line = _data_->_tmp1_;
		if (proton_plus_globals_IS_FLATPAK) {
			_data_->_tmp2_ = _data_->command_line;
			_data_->_tmp3_ = g_strconcat (_data_->_tmp2_, "flatpak-spawn --host ", NULL);
			_g_free0 (_data_->command_line);
			_data_->command_line = _data_->_tmp3_;
		}
		_data_->_tmp4_ = _data_->command_line;
		_data_->_tmp5_ = g_strconcat (_data_->_tmp4_, _data_->command, NULL);
		_g_free0 (_data_->command_line);
		_data_->command_line = _data_->_tmp5_;
		_data_->argv_length1 = 0;
		_data_->_argv_size_ = 0;
		_data_->_tmp6_ = _data_->command_line;
		_data_->_tmp7_ = NULL;
		_data_->_tmp8_ = 0;
		g_shell_parse_argv (_data_->_tmp6_, &_data_->_tmp8_, &_data_->_tmp7_, &_data_->_inner_error0_);
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
		_data_->argv = _data_->_tmp7_;
		_data_->argv_length1 = _data_->_tmp8_;
		_data_->_argv_size_ = _data_->argv_length1;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (_data_->command_line);
			goto __catch0_g_error;
		}
		_data_->_tmp9_ = _data_->argv;
		_data_->_tmp9__length1 = _data_->argv_length1;
		_data_->_tmp10_ = g_subprocess_newv (_data_->_tmp9_, G_SUBPROCESS_FLAGS_STDOUT_PIPE | G_SUBPROCESS_FLAGS_STDERR_MERGE, &_data_->_inner_error0_);
		_data_->subprocess = _data_->_tmp10_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (_data_->command_line);
			goto __catch0_g_error;
		}
		_data_->_tmp11_ = _data_->subprocess;
		_data_->_tmp12_ = NULL;
		_data_->_state_ = 1;
		g_subprocess_communicate_async (_data_->_tmp11_, NULL, NULL, proton_plus_utils_system_run_command_ready, _data_);
		return FALSE;
		_state_1:
		g_subprocess_communicate_finish (_data_->_tmp11_, _data_->_res_, &_data_->_tmp12_, NULL, &_data_->_inner_error0_);
		_g_bytes_unref0 (_data_->stdout_bytes);
		_data_->stdout_bytes = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_bytes_unref0 (_data_->stdout_bytes);
			_g_object_unref0 (_data_->subprocess);
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (_data_->command_line);
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->stdout_bytes;
		if (_data_->_tmp13_ != NULL) {
			_data_->_tmp14_ = _data_->stdout_bytes;
			_data_->_tmp15_ = 0;
			_data_->_tmp16_ = g_bytes_get_data (_data_->_tmp14_, &_data_->_tmp15_);
			_data_->data = _data_->_tmp16_;
			_data_->data_length1 = _data_->_tmp15_;
			_data_->_data_size_ = _data_->data_length1;
			_data_->_tmp17_ = _data_->data;
			_data_->_tmp17__length1 = _data_->data_length1;
			_data_->_tmp18_ = g_new0 (gchar, _data_->_tmp17__length1 + 1);
			_data_->str_data = _data_->_tmp18_;
			_data_->str_data_length1 = _data_->_tmp17__length1 + 1;
			_data_->_str_data_size_ = _data_->str_data_length1;
			_data_->_tmp19_ = _data_->str_data;
			_data_->_tmp19__length1 = _data_->str_data_length1;
			_data_->_tmp20_ = _data_->data;
			_data_->_tmp20__length1 = _data_->data_length1;
			_data_->_tmp21_ = _data_->data;
			_data_->_tmp21__length1 = _data_->data_length1;
			memcpy (_data_->_tmp19_, _data_->_tmp20_, (gsize) _data_->_tmp21__length1);
			_data_->_tmp22_ = _data_->str_data;
			_data_->_tmp22__length1 = _data_->str_data_length1;
			_data_->_tmp23_ = _data_->data;
			_data_->_tmp23__length1 = _data_->data_length1;
			_data_->_tmp22_[_data_->_tmp23__length1] = '\0';
			_data_->_tmp24_ = _data_->str_data;
			_data_->_tmp24__length1 = _data_->str_data_length1;
			_data_->_tmp25_ = g_strdup ((const gchar*) _data_->_tmp24_);
			_g_free0 (_data_->output);
			_data_->output = _data_->_tmp25_;
			_data_->str_data = (g_free (_data_->str_data), NULL);
		}
		_g_bytes_unref0 (_data_->stdout_bytes);
		_g_object_unref0 (_data_->subprocess);
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (_data_->command_line);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp26_ = _data_->e;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		g_warning ("system.vala:26: %s", _data_->_tmp27_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->output);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->output;
	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
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

GList*
proton_plus_utils_system_get_hwcaps (void)
{
	GList* hwcaps = NULL;
	gchar* flags = NULL;
	gchar* _tmp0_;
	const gchar* _tmp17_;
	gchar* _tmp48_;
	GList* _tmp49_;
	GError* _inner_error0_ = NULL;
	GList* result;
	hwcaps = NULL;
	_tmp0_ = g_strdup ("");
	flags = _tmp0_;
	{
		GFile* file = NULL;
		GFile* _tmp1_;
		GFile* _tmp2_;
		_tmp1_ = g_file_new_for_path ("/proc/cpuinfo");
		file = _tmp1_;
		_tmp2_ = file;
		if (g_file_query_exists (_tmp2_, NULL)) {
			GInputStream* input_stream = NULL;
			GFile* _tmp3_;
			GFileInputStream* _tmp4_;
			GDataInputStream* dis = NULL;
			GInputStream* _tmp5_;
			GDataInputStream* _tmp6_;
			gchar* line = NULL;
			_tmp3_ = file;
			_tmp4_ = g_file_read (_tmp3_, NULL, &_inner_error0_);
			input_stream = (GInputStream*) _tmp4_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (file);
				goto __catch0_g_error;
			}
			_tmp5_ = input_stream;
			_tmp6_ = g_data_input_stream_new (_tmp5_);
			dis = _tmp6_;
			while (TRUE) {
				gchar* _tmp7_ = NULL;
				GDataInputStream* _tmp8_;
				gchar* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				_tmp8_ = dis;
				_tmp9_ = g_data_input_stream_read_line (_tmp8_, NULL, NULL, &_inner_error0_);
				_tmp7_ = _tmp9_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (line);
					_g_object_unref0 (dis);
					_g_object_unref0 (input_stream);
					_g_object_unref0 (file);
					goto __catch0_g_error;
				}
				_tmp10_ = _tmp7_;
				_tmp7_ = NULL;
				_g_free0 (line);
				line = _tmp10_;
				_tmp11_ = line;
				if (!(_tmp11_ != NULL)) {
					_g_free0 (_tmp7_);
					break;
				}
				_tmp12_ = line;
				if (g_str_has_prefix (_tmp12_, "flags")) {
					const gchar* _tmp13_;
					gchar* _tmp14_;
					_tmp13_ = line;
					_tmp14_ = g_strdup (_tmp13_);
					_g_free0 (flags);
					flags = _tmp14_;
					_g_free0 (_tmp7_);
					break;
				}
				_g_free0 (_tmp7_);
			}
			_g_free0 (line);
			_g_object_unref0 (dis);
			_g_object_unref0 (input_stream);
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp15_;
		const gchar* _tmp16_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp15_ = e;
		_tmp16_ = _tmp15_->message;
		g_warning ("system.vala:51: Error: %s\n", _tmp16_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (flags);
		(hwcaps == NULL) ? NULL : (hwcaps = (_g_list_free__g_free0_ (hwcaps), NULL));
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp17_ = flags;
	if (g_strcmp0 (_tmp17_, "") != 0) {
		gchar** f = NULL;
		const gchar* _tmp18_;
		gchar** _tmp19_;
		gchar** _tmp20_;
		gint f_length1;
		gint _f_size_;
		GeeHashSet* flag_set = NULL;
		GeeHashSet* _tmp21_;
		gchar** _tmp22_;
		gint _tmp22__length1;
		gboolean _tmp26_ = FALSE;
		gboolean _tmp27_ = FALSE;
		GeeHashSet* _tmp28_;
		gboolean has_v2 = FALSE;
		gboolean _tmp31_ = FALSE;
		gboolean _tmp32_ = FALSE;
		gboolean has_v3 = FALSE;
		gboolean _tmp35_ = FALSE;
		gboolean _tmp36_ = FALSE;
		gboolean _tmp37_ = FALSE;
		gboolean _tmp38_ = FALSE;
		gboolean _tmp39_ = FALSE;
		gboolean has_v4 = FALSE;
		_tmp18_ = flags;
		_tmp20_ = _tmp19_ = g_strsplit (_tmp18_, " ", 0);
		f = _tmp20_;
		f_length1 = _vala_array_length (_tmp19_);
		_f_size_ = f_length1;
		_tmp21_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
		flag_set = _tmp21_;
		_tmp22_ = f;
		_tmp22__length1 = f_length1;
		{
			gchar** s_collection = NULL;
			gint s_collection_length1 = 0;
			gint _s_collection_size_ = 0;
			gint s_it = 0;
			s_collection = _tmp22_;
			s_collection_length1 = _tmp22__length1;
			for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
				gchar* _tmp23_;
				gchar* s = NULL;
				_tmp23_ = g_strdup (s_collection[s_it]);
				s = _tmp23_;
				{
					GeeHashSet* _tmp24_;
					const gchar* _tmp25_;
					_tmp24_ = flag_set;
					_tmp25_ = s;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp24_, _tmp25_);
					_g_free0 (s);
				}
			}
		}
		_tmp28_ = flag_set;
		if (gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp28_, "sse4_1")) {
			GeeHashSet* _tmp29_;
			_tmp29_ = flag_set;
			_tmp27_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp29_, "sse4_2");
		} else {
			_tmp27_ = FALSE;
		}
		if (_tmp27_) {
			GeeHashSet* _tmp30_;
			_tmp30_ = flag_set;
			_tmp26_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp30_, "ssse3");
		} else {
			_tmp26_ = FALSE;
		}
		has_v2 = _tmp26_;
		if (has_v2) {
			GeeHashSet* _tmp33_;
			_tmp33_ = flag_set;
			_tmp32_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp33_, "avx");
		} else {
			_tmp32_ = FALSE;
		}
		if (_tmp32_) {
			GeeHashSet* _tmp34_;
			_tmp34_ = flag_set;
			_tmp31_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp34_, "avx2");
		} else {
			_tmp31_ = FALSE;
		}
		has_v3 = _tmp31_;
		if (has_v3) {
			GeeHashSet* _tmp40_;
			_tmp40_ = flag_set;
			_tmp39_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp40_, "avx512f");
		} else {
			_tmp39_ = FALSE;
		}
		if (_tmp39_) {
			GeeHashSet* _tmp41_;
			_tmp41_ = flag_set;
			_tmp38_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp41_, "avx512bw");
		} else {
			_tmp38_ = FALSE;
		}
		if (_tmp38_) {
			GeeHashSet* _tmp42_;
			_tmp42_ = flag_set;
			_tmp37_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp42_, "avx512cd");
		} else {
			_tmp37_ = FALSE;
		}
		if (_tmp37_) {
			GeeHashSet* _tmp43_;
			_tmp43_ = flag_set;
			_tmp36_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp43_, "avx512dq");
		} else {
			_tmp36_ = FALSE;
		}
		if (_tmp36_) {
			GeeHashSet* _tmp44_;
			_tmp44_ = flag_set;
			_tmp35_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp44_, "avx512vl");
		} else {
			_tmp35_ = FALSE;
		}
		has_v4 = _tmp35_;
		if (has_v4) {
			gchar* _tmp45_;
			_tmp45_ = g_strdup ("x86_64_v4");
			hwcaps = g_list_append (hwcaps, _tmp45_);
		}
		if (has_v3) {
			gchar* _tmp46_;
			_tmp46_ = g_strdup ("x86_64_v3");
			hwcaps = g_list_append (hwcaps, _tmp46_);
		}
		if (has_v2) {
			gchar* _tmp47_;
			_tmp47_ = g_strdup ("x86_64_v2");
			hwcaps = g_list_append (hwcaps, _tmp47_);
		}
		_g_object_unref0 (flag_set);
		f = (_vala_array_free (f, f_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp48_ = g_strdup ("x86_64");
	hwcaps = g_list_append (hwcaps, _tmp48_);
	_tmp49_ = hwcaps;
	hwcaps = NULL;
	result = _tmp49_;
	_g_free0 (flags);
	(hwcaps == NULL) ? NULL : (hwcaps = (_g_list_free__g_free0_ (hwcaps), NULL));
	return result;
}

static void
proton_plus_utils_system_check_dependency_data_free (gpointer _data)
{
	ProtonPlusUtilsSystemCheckDependencyData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	g_slice_free (ProtonPlusUtilsSystemCheckDependencyData, _data_);
}

void
proton_plus_utils_system_check_dependency (const gchar* name,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	ProtonPlusUtilsSystemCheckDependencyData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsSystemCheckDependencyData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_system_check_dependency_data_free);
	_tmp0_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp0_;
	proton_plus_utils_system_check_dependency_co (_data_);
}

gboolean
proton_plus_utils_system_check_dependency_finish (GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusUtilsSystemCheckDependencyData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
proton_plus_utils_system_check_dependency_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	ProtonPlusUtilsSystemCheckDependencyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_system_check_dependency_co (_data_);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
proton_plus_utils_system_check_dependency_co (ProtonPlusUtilsSystemCheckDependencyData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = string_to_string (_data_->name);
	_data_->_tmp2_ = g_strconcat ("which ", _data_->_tmp1_, NULL);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	proton_plus_utils_system_run_command (_data_->_tmp3_, proton_plus_utils_system_check_dependency_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = proton_plus_utils_system_run_command_finish (_data_->_res_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = string_contains (_data_->_tmp5_, "which: no");
	_g_free0 (_data_->_tmp5_);
	_g_free0 (_data_->_tmp3_);
	if (_data_->_tmp6_) {
		_data_->_tmp0_ = FALSE;
	} else {
		_data_->_tmp0_ = TRUE;
	}
	_data_->result = _data_->_tmp0_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_utils_system_get_distribution_name_data_free (gpointer _data)
{
	ProtonPlusUtilsSystemGetDistributionNameData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	g_slice_free (ProtonPlusUtilsSystemGetDistributionNameData, _data_);
}

void
proton_plus_utils_system_get_distribution_name (GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusUtilsSystemGetDistributionNameData* _data_;
	_data_ = g_slice_new0 (ProtonPlusUtilsSystemGetDistributionNameData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_system_get_distribution_name_data_free);
	proton_plus_utils_system_get_distribution_name_co (_data_);
}

gchar*
proton_plus_utils_system_get_distribution_name_finish (GAsyncResult* _res_)
{
	gchar* result;
	ProtonPlusUtilsSystemGetDistributionNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	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 gboolean
proton_plus_utils_system_get_distribution_name_co (ProtonPlusUtilsSystemGetDistributionNameData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("Unknown");
	_data_->distro_name = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_file_new_for_path ("/etc/os-release");
		_data_->file = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->file;
		if (!g_file_query_exists (_data_->_tmp2_, NULL)) {
			_data_->_tmp3_ = g_file_new_for_path ("/usr/lib/os-release");
			_g_object_unref0 (_data_->file);
			_data_->file = _data_->_tmp3_;
		}
		_data_->_tmp4_ = _data_->file;
		if (g_file_query_exists (_data_->_tmp4_, NULL)) {
			_data_->_tmp6_ = _data_->file;
			_data_->_tmp7_ = g_file_read (_data_->_tmp6_, NULL, &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp7_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file);
				goto __catch0_g_error;
			}
			_data_->_tmp8_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp5_);
			_data_->dis = _data_->_tmp8_;
			while (TRUE) {
				_data_->_tmp10_ = _data_->dis;
				_data_->_tmp11_ = g_data_input_stream_read_line (_data_->_tmp10_, NULL, NULL, &_data_->_inner_error0_);
				_data_->_tmp9_ = _data_->_tmp11_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_free0 (_data_->line);
					_g_object_unref0 (_data_->dis);
					_g_object_unref0 (_data_->_tmp5_);
					_g_object_unref0 (_data_->file);
					goto __catch0_g_error;
				}
				_data_->_tmp12_ = _data_->_tmp9_;
				_data_->_tmp9_ = NULL;
				_g_free0 (_data_->line);
				_data_->line = _data_->_tmp12_;
				_data_->_tmp13_ = _data_->line;
				if (!(_data_->_tmp13_ != NULL)) {
					_g_free0 (_data_->_tmp9_);
					break;
				}
				_data_->_tmp14_ = _data_->line;
				if (g_str_has_prefix (_data_->_tmp14_, "NAME=")) {
					_data_->_tmp15_ = _data_->line;
					_data_->_tmp16_ = string_substring (_data_->_tmp15_, (glong) 5, (glong) -1);
					_data_->_tmp17_ = _data_->_tmp16_;
					_data_->_tmp18_ = string_replace (_data_->_tmp17_, "\"", "");
					_data_->_tmp19_ = _data_->_tmp18_;
					_data_->_tmp20_ = string_replace (_data_->_tmp19_, "'", "");
					_g_free0 (_data_->distro_name);
					_data_->distro_name = _data_->_tmp20_;
					_g_free0 (_data_->_tmp19_);
					_g_free0 (_data_->_tmp17_);
					_g_free0 (_data_->_tmp9_);
					break;
				}
				_g_free0 (_data_->_tmp9_);
			}
			_g_free0 (_data_->line);
			_g_object_unref0 (_data_->dis);
			_g_object_unref0 (_data_->_tmp5_);
		}
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp21_ = _data_->e;
		_data_->_tmp22_ = _data_->_tmp21_->message;
		g_warning ("system.vala:96: %s", _data_->_tmp22_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->distro_name);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->distro_name;
	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
__lambda11_ (GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		g_app_info_launch_default_for_uri_finish (res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = _error_;
		_tmp1_ = _tmp0_->message;
		g_warning ("system.vala:107: %s", _tmp1_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda11__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda11_ (source_object, res);
}

void
proton_plus_utils_system_open_uri (const gchar* uri)
{
	g_return_if_fail (uri != NULL);
	g_app_info_launch_default_for_uri_async (uri, NULL, NULL, ___lambda11__gasync_ready_callback, NULL);
}

static void
proton_plus_utils_system_get_protontricks_exec_data_free (gpointer _data)
{
	ProtonPlusUtilsSystemGetProtontricksExecData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	g_slice_free (ProtonPlusUtilsSystemGetProtontricksExecData, _data_);
}

void
proton_plus_utils_system_get_protontricks_exec (GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusUtilsSystemGetProtontricksExecData* _data_;
	_data_ = g_slice_new0 (ProtonPlusUtilsSystemGetProtontricksExecData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_system_get_protontricks_exec_data_free);
	proton_plus_utils_system_get_protontricks_exec_co (_data_);
}

gchar*
proton_plus_utils_system_get_protontricks_exec_finish (GAsyncResult* _res_)
{
	gchar* result;
	ProtonPlusUtilsSystemGetProtontricksExecData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
proton_plus_utils_system_get_protontricks_exec_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ProtonPlusUtilsSystemGetProtontricksExecData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_system_get_protontricks_exec_co (_data_);
}

static gboolean
proton_plus_utils_system_get_protontricks_exec_co (ProtonPlusUtilsSystemGetProtontricksExecData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("protontricks");
	_data_->_tmp1_ = g_strdup ("com.github.Matoking.protontricks");
	_data_->_tmp2_ = g_new0 (gchar*, 2 + 1);
	_data_->_tmp2_[0] = _data_->_tmp0_;
	_data_->_tmp2_[1] = _data_->_tmp1_;
	_data_->protontricks_execs = _data_->_tmp2_;
	_data_->protontricks_execs_length1 = 2;
	_data_->_protontricks_execs_size_ = _data_->protontricks_execs_length1;
	_data_->_tmp3_ = _data_->protontricks_execs;
	_data_->_tmp3__length1 = _data_->protontricks_execs_length1;
	{
		_data_->protontricks_exec_collection_length1 = 0;
		_data_->_protontricks_exec_collection_size_ = 0;
		_data_->protontricks_exec_collection = _data_->_tmp3_;
		_data_->protontricks_exec_collection_length1 = _data_->_tmp3__length1;
		for (_data_->protontricks_exec_it = 0; _data_->protontricks_exec_it < _data_->protontricks_exec_collection_length1; _data_->protontricks_exec_it = _data_->protontricks_exec_it + 1) {
			_data_->_tmp4_ = g_strdup (_data_->protontricks_exec_collection[_data_->protontricks_exec_it]);
			_data_->protontricks_exec = _data_->_tmp4_;
			{
				_data_->_tmp5_ = _data_->protontricks_exec;
				_data_->_state_ = 1;
				proton_plus_utils_system_check_dependency (_data_->_tmp5_, proton_plus_utils_system_get_protontricks_exec_ready, _data_);
				return FALSE;
				_state_1:
				if (proton_plus_utils_system_check_dependency_finish (_data_->_res_)) {
					_data_->result = _data_->protontricks_exec;
					_data_->protontricks_execs = (_vala_array_free (_data_->protontricks_execs, _data_->protontricks_execs_length1, (GDestroyNotify) g_free), NULL);
					g_task_return_pointer (_data_->_async_result, _data_, NULL);
					if (_data_->_state_ != 0) {
						while (!g_task_get_completed (_data_->_async_result)) {
							g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
						}
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_g_free0 (_data_->protontricks_exec);
			}
		}
	}
	_data_->result = NULL;
	_data_->protontricks_execs = (_vala_array_free (_data_->protontricks_execs, _data_->protontricks_execs_length1, (GDestroyNotify) g_free), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

ProtonPlusUtilsSystem*
proton_plus_utils_system_construct (GType object_type)
{
	ProtonPlusUtilsSystem* self = NULL;
	self = (ProtonPlusUtilsSystem*) g_type_create_instance (object_type);
	return self;
}

ProtonPlusUtilsSystem*
proton_plus_utils_system_new (void)
{
	return proton_plus_utils_system_construct (PROTON_PLUS_UTILS_TYPE_SYSTEM);
}

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

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

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

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

static gchar*
proton_plus_utils_value_system_collect_value (GValue* value,
                                              guint n_collect_values,
                                              GTypeCValue* collect_values,
                                              guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ProtonPlusUtilsSystem * 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_utils_system_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
proton_plus_utils_value_system_lcopy_value (const GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	ProtonPlusUtilsSystem ** 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_utils_system_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
proton_plus_utils_param_spec_system (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags)
{
	ProtonPlusUtilsParamSpecSystem* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PROTON_PLUS_UTILS_TYPE_SYSTEM), 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_utils_value_get_system (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_UTILS_TYPE_SYSTEM), NULL);
	return value->data[0].v_pointer;
}

void
proton_plus_utils_value_set_system (GValue* value,
                                    gpointer v_object)
{
	ProtonPlusUtilsSystem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_UTILS_TYPE_SYSTEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_UTILS_TYPE_SYSTEM));
		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_utils_system_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_utils_system_unref (old);
	}
}

void
proton_plus_utils_value_take_system (GValue* value,
                                     gpointer v_object)
{
	ProtonPlusUtilsSystem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_UTILS_TYPE_SYSTEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_UTILS_TYPE_SYSTEM));
		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_utils_system_unref (old);
	}
}

static void
proton_plus_utils_system_class_init (ProtonPlusUtilsSystemClass * klass,
                                     gpointer klass_data)
{
	proton_plus_utils_system_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusUtilsSystemClass *) klass)->finalize = proton_plus_utils_system_finalize;
}

static void
proton_plus_utils_system_instance_init (ProtonPlusUtilsSystem * self,
                                        gpointer klass)
{
	self->ref_count = 1;
}

static void
proton_plus_utils_system_finalize (ProtonPlusUtilsSystem * obj)
{
	ProtonPlusUtilsSystem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_SYSTEM, ProtonPlusUtilsSystem);
	g_signal_handlers_destroy (self);
}

static GType
proton_plus_utils_system_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { proton_plus_utils_value_system_init, proton_plus_utils_value_system_free_value, proton_plus_utils_value_system_copy_value, proton_plus_utils_value_system_peek_pointer, "p", proton_plus_utils_value_system_collect_value, "p", proton_plus_utils_value_system_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsSystemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_system_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsSystem), 0, (GInstanceInitFunc) proton_plus_utils_system_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_utils_system_type_id;
	proton_plus_utils_system_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ProtonPlusUtilsSystem", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return proton_plus_utils_system_type_id;
}

GType
proton_plus_utils_system_get_type (void)
{
	static volatile gsize proton_plus_utils_system_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_system_type_id__once)) {
		GType proton_plus_utils_system_type_id;
		proton_plus_utils_system_type_id = proton_plus_utils_system_get_type_once ();
		g_once_init_leave (&proton_plus_utils_system_type_id__once, proton_plus_utils_system_type_id);
	}
	return proton_plus_utils_system_type_id__once;
}

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

void
proton_plus_utils_system_unref (gpointer instance)
{
	ProtonPlusUtilsSystem * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PROTON_PLUS_UTILS_SYSTEM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

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

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

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

