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

#include "protonplus_core.h"
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <archive.h>
#include <archive_entry.h>
#include <glib/gstdio.h>
#include <unistd.h>
#include <errno.h>
#include <glib-object.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

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block68Data Block68Data;
#define _archive_write_free0(var) ((var == NULL) ? NULL : (var = (archive_write_free (var), NULL)))
#define _archive_read_free0(var) ((var == NULL) ? NULL : (var = (archive_read_free (var), NULL)))
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
typedef struct _ProtonPlusUtilsFilesystemExtractData ProtonPlusUtilsFilesystemExtractData;
typedef struct _ProtonPlusUtilsFilesystemMakeSymlinkData ProtonPlusUtilsFilesystemMakeSymlinkData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ProtonPlusUtilsFilesystemGetFileContentAsyncData ProtonPlusUtilsFilesystemGetFileContentAsyncData;
typedef struct _Block69Data Block69Data;
typedef struct _ProtonPlusUtilsFilesystemMoveDirectoryAtomicData ProtonPlusUtilsFilesystemMoveDirectoryAtomicData;
typedef struct _Block70Data Block70Data;
typedef struct _ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData;
typedef struct _ProtonPlusUtilsFilesystemCopyFileData ProtonPlusUtilsFilesystemCopyFileData;
typedef struct _ProtonPlusUtilsFilesystemCopyFileVerifiedData ProtonPlusUtilsFilesystemCopyFileVerifiedData;
typedef struct _ProtonPlusUtilsFilesystemMoveDirectoryData ProtonPlusUtilsFilesystemMoveDirectoryData;
typedef struct _ProtonPlusUtilsFilesystemCopyDirectoryData ProtonPlusUtilsFilesystemCopyDirectoryData;
typedef struct _Block71Data Block71Data;
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))
typedef struct _ProtonPlusUtilsFilesystemMoveDirContentsData ProtonPlusUtilsFilesystemMoveDirContentsData;
typedef struct _Block72Data Block72Data;
typedef struct _ProtonPlusUtilsFilesystemDeleteDirectoryData ProtonPlusUtilsFilesystemDeleteDirectoryData;
typedef struct _Block73Data Block73Data;
typedef struct _ProtonPlusUtilsFilesystemCreateDirectoryAsyncData ProtonPlusUtilsFilesystemCreateDirectoryAsyncData;
typedef struct _ProtonPlusUtilsParamSpecFilesystem ProtonPlusUtilsParamSpecFilesystem;

struct _Block68Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gchar* output;
	gchar* install_location;
	gchar* tool_name;
	gchar* extension;
	GCancellable* cancellable;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemExtractData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* install_location;
	gchar* tool_name;
	gchar* extension;
	GCancellable* cancellable;
	gchar* result;
	Block68Data* _data68_;
	gchar* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	gchar* _tmp3_;
};

struct _ProtonPlusUtilsFilesystemMakeSymlinkData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* link_location;
	gchar* target_path;
	gboolean result;
	GFile* link_file;
	GFile* _tmp0_;
	GFile* _tmp1_;
	gboolean link_deleted;
	gboolean link_created;
	GFile* _tmp2_;
	GError* _inner_error0_;
};

struct _ProtonPlusUtilsFilesystemGetFileContentAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* path;
	gboolean use_uri;
	gchar* result;
	gchar* output;
	gchar* _tmp0_;
	GFile* file;
	GFile* _tmp1_;
	GFile* _tmp2_;
	guint8* contents;
	gint contents_length1;
	gint _contents_size_;
	gchar* etag_out;
	GFile* _tmp3_;
	guint8* _tmp4_;
	gsize _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GError* e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _Block69Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean output;
	gchar* source;
	gchar* destination;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemMoveDirectoryAtomicData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	Block69Data* _data69_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _Block70Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean output;
	gchar* source;
	gchar* destination;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	Block70Data* _data70_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _ProtonPlusUtilsFilesystemCopyFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	GFile* source_file;
	GFile* _tmp0_;
	GFile* destination_file;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GError* e;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GError* _inner_error0_;
};

struct _ProtonPlusUtilsFilesystemCopyFileVerifiedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	guint8* source_contents;
	gint source_contents_length1;
	gint _source_contents_size_;
	guint8* destination_contents;
	gint destination_contents_length1;
	gint _destination_contents_size_;
	gchar* source_etag;
	gchar* destination_etag;
	GFile* _tmp0_;
	GFile* _tmp1_;
	guint8* _tmp2_;
	gsize _tmp3_;
	gchar* _tmp4_;
	GFile* _tmp5_;
	GFile* _tmp6_;
	guint8* _tmp7_;
	gsize _tmp8_;
	gchar* _tmp9_;
	guint8* _tmp10_;
	gint _tmp10__length1;
	guint8* _tmp11_;
	gint _tmp11__length1;
	gint index;
	gboolean _tmp12_;
	gint _tmp13_;
	guint8* _tmp14_;
	gint _tmp14__length1;
	guint8* _tmp15_;
	gint _tmp15__length1;
	guint8 _tmp16_;
	guint8* _tmp17_;
	gint _tmp17__length1;
	guint8 _tmp18_;
	GError* e;
	GError* _tmp19_;
	const gchar* _tmp20_;
	GError* _inner_error0_;
};

struct _ProtonPlusUtilsFilesystemMoveDirectoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	gboolean destination_existed;
	gboolean copied;
	gboolean _tmp0_;
};

struct _ProtonPlusUtilsFilesystemCopyDirectoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source;
	gchar* destination;
	gboolean result;
	GFile* src;
	GFile* _tmp0_;
	GFile* dest;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GFileEnumerator* enumerator;
	GFile* _tmp5_;
	GFileEnumerator* _tmp6_;
	GFileInfo* file_info;
	GFileInfo* _tmp7_;
	GFileEnumerator* _tmp8_;
	GFileInfo* _tmp9_;
	GFileInfo* _tmp10_;
	GFileInfo* _tmp11_;
	gchar* file_name;
	GFileInfo* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	GFile* src_file;
	GFile* _tmp15_;
	const gchar* _tmp16_;
	GFile* _tmp17_;
	GFile* dest_file;
	GFile* _tmp18_;
	const gchar* _tmp19_;
	GFile* _tmp20_;
	GFileInfo* _tmp21_;
	GFile* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GFile* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gboolean _tmp28_;
	GFile* _tmp29_;
	GFile* _tmp30_;
	GError* e;
	const gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	GError* _vala1_e;
	GError* _tmp34_;
	const gchar* _tmp35_;
	GError* _inner_error0_;
};

struct _Block71Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean output;
	gchar* source_dir;
	gchar* target_dir;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemMoveDirContentsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* source_dir;
	gchar* target_dir;
	gboolean result;
	Block71Data* _data71_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _Block72Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean output;
	gchar* path;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemDeleteDirectoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* path;
	gboolean result;
	Block72Data* _data72_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _Block73Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean output;
	gchar* path;
	gpointer _async_data_;
};

struct _ProtonPlusUtilsFilesystemCreateDirectoryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* path;
	gboolean result;
	Block73Data* _data73_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _ProtonPlusUtilsParamSpecFilesystem {
	GParamSpec parent_instance;
};

static gpointer proton_plus_utils_filesystem_parent_class = NULL;
static gchar** proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS;
static gint proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_length1;
static gchar** proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS = NULL;
static gint proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_length1 = 0;
static gint _proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_size_ = 0;

static void proton_plus_utils_filesystem_extract_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_extract_co (ProtonPlusUtilsFilesystemExtractData* _data_);
static Block68Data* block68_data_ref (Block68Data* _data68_);
static void block68_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_extract_co_gsource_func (gpointer self);
static void __lambda4_ (Block68Data* _data68_);
static gchar* proton_plus_utils_filesystem_normalize_archive_entry (const gchar* path);
static gssize proton_plus_utils_filesystem_copy_data (struct archive* ar,
                                               struct archive* aw,
                                               GCancellable* cancellable);
static gpointer ___lambda4__gthread_func (gpointer self);
static guint8* _vala_array_dup53 (guint8* self,
                           gssize length);
static void proton_plus_utils_filesystem_make_symlink_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_make_symlink_co (ProtonPlusUtilsFilesystemMakeSymlinkData* _data_);
static void proton_plus_utils_filesystem_make_symlink_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void proton_plus_utils_filesystem_get_file_content_async_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_get_file_content_async_co (ProtonPlusUtilsFilesystemGetFileContentAsyncData* _data_);
static void proton_plus_utils_filesystem_get_file_content_async_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static gboolean proton_plus_utils_filesystem_delete_file_direct (const gchar* path);
static void proton_plus_utils_filesystem_move_directory_atomic_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_move_directory_atomic_co (ProtonPlusUtilsFilesystemMoveDirectoryAtomicData* _data_);
static Block69Data* block69_data_ref (Block69Data* _data69_);
static void block69_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_move_directory_atomic_co_gsource_func (gpointer self);
static void __lambda5_ (Block69Data* _data69_);
static gpointer ___lambda5__gthread_func (gpointer self);
static void proton_plus_utils_filesystem_move_file_atomic_if_absent_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_move_file_atomic_if_absent_co (ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData* _data_);
static Block70Data* block70_data_ref (Block70Data* _data70_);
static void block70_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_move_file_atomic_if_absent_co_gsource_func (gpointer self);
static void __lambda6_ (Block70Data* _data70_);
static gpointer ___lambda6__gthread_func (gpointer self);
static void proton_plus_utils_filesystem_copy_file_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_copy_file_co (ProtonPlusUtilsFilesystemCopyFileData* _data_);
static void proton_plus_utils_filesystem_copy_file_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void proton_plus_utils_filesystem_copy_file_verified_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_copy_file_verified_co (ProtonPlusUtilsFilesystemCopyFileVerifiedData* _data_);
static void proton_plus_utils_filesystem_copy_file_verified_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
static void proton_plus_utils_filesystem_move_directory_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_move_directory_co (ProtonPlusUtilsFilesystemMoveDirectoryData* _data_);
static void proton_plus_utils_filesystem_move_directory_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void proton_plus_utils_filesystem_copy_directory_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_copy_directory_co (ProtonPlusUtilsFilesystemCopyDirectoryData* _data_);
static void proton_plus_utils_filesystem_copy_directory_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void proton_plus_utils_filesystem_move_dir_contents_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_move_dir_contents_co (ProtonPlusUtilsFilesystemMoveDirContentsData* _data_);
static Block71Data* block71_data_ref (Block71Data* _data71_);
static void block71_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_move_dir_contents_co_gsource_func (gpointer self);
static void __lambda8_ (Block71Data* _data71_);
static gpointer ___lambda8__gthread_func (gpointer self);
static gboolean proton_plus_utils_filesystem_delete_directory_direct (const gchar* path);
static void proton_plus_utils_filesystem_delete_directory_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_delete_directory_co (ProtonPlusUtilsFilesystemDeleteDirectoryData* _data_);
static Block72Data* block72_data_ref (Block72Data* _data72_);
static void block72_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_delete_directory_co_gsource_func (gpointer self);
static void __lambda7_ (Block72Data* _data72_);
static gpointer ___lambda7__gthread_func (gpointer self);
static void proton_plus_utils_filesystem_create_directory_async_data_free (gpointer _data);
static gboolean proton_plus_utils_filesystem_create_directory_async_co (ProtonPlusUtilsFilesystemCreateDirectoryAsyncData* _data_);
static Block73Data* block73_data_ref (Block73Data* _data73_);
static void block73_data_unref (void * _userdata_);
static gboolean _proton_plus_utils_filesystem_create_directory_async_co_gsource_func (gpointer self);
static void __lambda9_ (Block73Data* _data73_);
static gpointer ___lambda9__gthread_func (gpointer self);
static void proton_plus_utils_filesystem_finalize (ProtonPlusUtilsFilesystem * obj);
static GType proton_plus_utils_filesystem_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);

gboolean
proton_plus_utils_filesystem_is_valid_schema (GSettingsSchema* schema)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gboolean result;
	g_return_val_if_fail (schema != NULL, FALSE);
	_tmp0_ = proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS;
	_tmp0__length1 = proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_length1;
	{
		gchar** key_collection = NULL;
		gint key_collection_length1 = 0;
		gint _key_collection_size_ = 0;
		gint key_it = 0;
		key_collection = _tmp0_;
		key_collection_length1 = _tmp0__length1;
		for (key_it = 0; key_it < key_collection_length1; key_it = key_it + 1) {
			gchar* _tmp1_;
			gchar* key = NULL;
			_tmp1_ = g_strdup (key_collection[key_it]);
			key = _tmp1_;
			{
				const gchar* _tmp2_;
				_tmp2_ = key;
				if (!g_settings_schema_has_key (schema, _tmp2_)) {
					const gchar* _tmp3_;
					_tmp3_ = key;
					g_warning ("filesystem.vala:18: Missing required GSettings key: %s", _tmp3_);
					result = FALSE;
					_g_free0 (key);
					return result;
				}
				_g_free0 (key);
			}
		}
	}
	result = TRUE;
	return result;
}

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

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

void
proton_plus_utils_filesystem_extract (const gchar* install_location,
                                      const gchar* tool_name,
                                      const gchar* extension,
                                      GCancellable* cancellable,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemExtractData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (install_location != NULL);
	g_return_if_fail (tool_name != NULL);
	g_return_if_fail (extension != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemExtractData);
	_data_->_async_result = g_task_new (NULL, cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_extract_data_free);
	_tmp0_ = g_strdup (install_location);
	_g_free0 (_data_->install_location);
	_data_->install_location = _tmp0_;
	_tmp1_ = g_strdup (tool_name);
	_g_free0 (_data_->tool_name);
	_data_->tool_name = _tmp1_;
	_tmp2_ = g_strdup (extension);
	_g_free0 (_data_->extension);
	_data_->extension = _tmp2_;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	proton_plus_utils_filesystem_extract_co (_data_);
}

gchar*
proton_plus_utils_filesystem_extract_finish (GAsyncResult* _res_)
{
	gchar* result;
	ProtonPlusUtilsFilesystemExtractData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block68Data*
block68_data_ref (Block68Data* _data68_)
{
	g_atomic_int_inc (&_data68_->_ref_count_);
	return _data68_;
}

static void
block68_data_unref (void * _userdata_)
{
	Block68Data* _data68_;
	_data68_ = (Block68Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data68_->_ref_count_)) {
		_g_free0 (_data68_->output);
		(_data68_->callback_target_destroy_notify == NULL) ? NULL : (_data68_->callback_target_destroy_notify (_data68_->callback_target), NULL);
		_data68_->callback = NULL;
		_data68_->callback_target = NULL;
		_data68_->callback_target_destroy_notify = NULL;
		_g_free0 (_data68_->install_location);
		_g_free0 (_data68_->tool_name);
		_g_free0 (_data68_->extension);
		_g_object_unref0 (_data68_->cancellable);
		g_slice_free (Block68Data, _data68_);
	}
}

static gboolean
_proton_plus_utils_filesystem_extract_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_extract_co (self);
	return result;
}

static void
__lambda4_ (Block68Data* _data68_)
{
	static const gint BUFFER_SIZE = 192000;
	gchar* extraction_location = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	struct archive* archive = NULL;
	struct archive* _tmp3_;
	struct archive* _tmp4_;
	struct archive* _tmp5_;
	gint flags = 0;
	struct archive* ext = NULL;
	struct archive* _tmp6_;
	struct archive* _tmp7_;
	struct archive* _tmp8_;
	gchar* archive_path = NULL;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	struct archive* _tmp14_;
	const gchar* _tmp15_;
	gssize r = 0L;
	struct archive_entry* entry = NULL;
	gchar* source_path = NULL;
	gchar* _tmp17_;
	gboolean first_run = FALSE;
	struct archive* _tmp60_;
	const gchar* _tmp61_;
	GSourceFunc _tmp65_;
	gpointer _tmp65__target;
	GDestroyNotify _tmp65__target_destroy_notify;
	_tmp0_ = realpath (_data68_->install_location, NULL);
	extraction_location = _tmp0_;
	_tmp1_ = extraction_location;
	if (_tmp1_ == NULL) {
		GSourceFunc _tmp2_;
		gpointer _tmp2__target;
		GDestroyNotify _tmp2__target_destroy_notify;
		g_warning ("filesystem.vala:38: Could not resolve extraction directory: %s", _data68_->install_location);
		_tmp2_ = _data68_->callback;
		_tmp2__target = _data68_->callback_target;
		_tmp2__target_destroy_notify = _data68_->callback_target_destroy_notify;
		_data68_->callback = NULL;
		_data68_->callback_target = NULL;
		_data68_->callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
		_g_free0 (extraction_location);
		return;
	}
	_tmp3_ = archive_read_new ();
	archive = _tmp3_;
	_tmp4_ = archive;
	archive_read_support_format_all (_tmp4_);
	_tmp5_ = archive;
	archive_read_support_filter_all (_tmp5_);
	flags = (gint) ARCHIVE_EXTRACT_ACL;
	flags |= (gint) ARCHIVE_EXTRACT_PERM;
	flags |= (gint) ARCHIVE_EXTRACT_TIME;
	flags |= (gint) ARCHIVE_EXTRACT_FFLAGS;
	flags |= (gint) ARCHIVE_EXTRACT_SECURE_SYMLINKS;
	flags |= (gint) ARCHIVE_EXTRACT_SECURE_NODOTDOT;
	_tmp6_ = archive_write_disk_new ();
	ext = _tmp6_;
	_tmp7_ = ext;
	archive_write_disk_set_standard_lookup (_tmp7_);
	_tmp8_ = ext;
	archive_write_disk_set_options (_tmp8_, flags);
	_tmp9_ = extraction_location;
	_tmp10_ = g_strconcat (_data68_->tool_name, _data68_->extension, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_build_filename ((const gchar*) _tmp9_, _tmp11_, NULL);
	_tmp13_ = _tmp12_;
	_g_free0 (_tmp11_);
	archive_path = _tmp13_;
	_tmp14_ = archive;
	_tmp15_ = archive_path;
	if (archive_read_open_filename (_tmp14_, _tmp15_, (gsize) BUFFER_SIZE) != ARCHIVE_OK) {
		GSourceFunc _tmp16_;
		gpointer _tmp16__target;
		GDestroyNotify _tmp16__target_destroy_notify;
		_tmp16_ = _data68_->callback;
		_tmp16__target = _data68_->callback_target;
		_tmp16__target_destroy_notify = _data68_->callback_target_destroy_notify;
		_data68_->callback = NULL;
		_data68_->callback_target = NULL;
		_data68_->callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT, _tmp16_, _tmp16__target, _tmp16__target_destroy_notify);
		_g_free0 (archive_path);
		_archive_write_free0 (ext);
		_archive_read_free0 (archive);
		_g_free0 (extraction_location);
		return;
	}
	_tmp17_ = g_strdup ("");
	source_path = _tmp17_;
	first_run = TRUE;
	{
		gboolean _tmp18_ = FALSE;
		_tmp18_ = TRUE;
		while (TRUE) {
			struct archive* _tmp19_;
			struct archive_entry* _tmp20_ = NULL;
			int _tmp21_;
			gchar* original_entry_path = NULL;
			struct archive_entry* _tmp25_;
			const gchar* _tmp26_;
			gchar* _tmp27_;
			gboolean _tmp28_ = FALSE;
			const gchar* _tmp29_;
			gchar* entry_path = NULL;
			const gchar* _tmp31_;
			gchar* _tmp32_;
			const gchar* _tmp33_;
			struct archive_entry* _tmp42_;
			const gchar* _tmp43_;
			const gchar* _tmp44_;
			gchar* _tmp45_;
			gchar* _tmp46_;
			struct archive* _tmp47_;
			struct archive_entry* _tmp48_;
			struct archive* _tmp56_;
			if (!_tmp18_) {
			}
			_tmp18_ = FALSE;
			if (g_cancellable_is_cancelled (_data68_->cancellable)) {
				break;
			}
			_tmp19_ = archive;
			_tmp21_ = archive_read_next_header (_tmp19_, &_tmp20_);
			entry = _tmp20_;
			r = (gssize) _tmp21_;
			if (r == ((gssize) ARCHIVE_EOF)) {
				break;
			}
			if (r < ((gssize) ARCHIVE_OK)) {
				struct archive* _tmp22_;
				const gchar* _tmp23_;
				_tmp22_ = archive;
				_tmp23_ = archive_error_string (_tmp22_);
				g_warning ("filesystem.vala:81: Could not read archive entry: %s", _tmp23_);
			}
			if (r < ((gssize) ARCHIVE_WARN)) {
				GSourceFunc _tmp24_;
				gpointer _tmp24__target;
				GDestroyNotify _tmp24__target_destroy_notify;
				_tmp24_ = _data68_->callback;
				_tmp24__target = _data68_->callback_target;
				_tmp24__target_destroy_notify = _data68_->callback_target_destroy_notify;
				_data68_->callback = NULL;
				_data68_->callback_target = NULL;
				_data68_->callback_target_destroy_notify = NULL;
				g_idle_add_full (G_PRIORITY_DEFAULT, _tmp24_, _tmp24__target, _tmp24__target_destroy_notify);
				_g_free0 (source_path);
				_g_free0 (archive_path);
				_archive_write_free0 (ext);
				_archive_read_free0 (archive);
				_g_free0 (extraction_location);
				return;
			}
			_tmp25_ = entry;
			_tmp26_ = archive_entry_pathname (_tmp25_);
			_tmp27_ = g_strdup (_tmp26_);
			original_entry_path = _tmp27_;
			_tmp29_ = original_entry_path;
			if (g_strcmp0 (_tmp29_, ".") == 0) {
				_tmp28_ = TRUE;
			} else {
				const gchar* _tmp30_;
				_tmp30_ = original_entry_path;
				_tmp28_ = g_strcmp0 (_tmp30_, "./") == 0;
			}
			if (_tmp28_) {
				_g_free0 (original_entry_path);
				continue;
			}
			_tmp31_ = original_entry_path;
			_tmp32_ = proton_plus_utils_filesystem_normalize_archive_entry (_tmp31_);
			entry_path = _tmp32_;
			_tmp33_ = entry_path;
			if (_tmp33_ == NULL) {
				const gchar* _tmp34_;
				GSourceFunc _tmp35_;
				gpointer _tmp35__target;
				GDestroyNotify _tmp35__target_destroy_notify;
				_tmp34_ = original_entry_path;
				g_warning ("filesystem.vala:94: Refusing to extract unsafe archive entry: %s", _tmp34_);
				_tmp35_ = _data68_->callback;
				_tmp35__target = _data68_->callback_target;
				_tmp35__target_destroy_notify = _data68_->callback_target_destroy_notify;
				_data68_->callback = NULL;
				_data68_->callback_target = NULL;
				_data68_->callback_target_destroy_notify = NULL;
				g_idle_add_full (G_PRIORITY_DEFAULT, _tmp35_, _tmp35__target, _tmp35__target_destroy_notify);
				_g_free0 (entry_path);
				_g_free0 (original_entry_path);
				_g_free0 (source_path);
				_g_free0 (archive_path);
				_archive_write_free0 (ext);
				_archive_read_free0 (archive);
				_g_free0 (extraction_location);
				return;
			}
			if (first_run) {
				const gchar* _tmp36_;
				gchar** _tmp37_;
				gchar** _tmp38_;
				gchar** _tmp39_;
				gint _tmp39__length1;
				const gchar* _tmp40_;
				gchar* _tmp41_;
				_tmp36_ = entry_path;
				_tmp38_ = _tmp37_ = g_strsplit (_tmp36_, "/", 2);
				_tmp39_ = _tmp38_;
				_tmp39__length1 = _vala_array_length (_tmp37_);
				_tmp40_ = _tmp39_[0];
				_tmp41_ = g_strdup (_tmp40_);
				_g_free0 (source_path);
				source_path = _tmp41_;
				_tmp39_ = (_vala_array_free (_tmp39_, _tmp39__length1, (GDestroyNotify) g_free), NULL);
				first_run = FALSE;
			}
			_tmp42_ = entry;
			_tmp43_ = extraction_location;
			_tmp44_ = entry_path;
			_tmp45_ = g_build_filename ((const gchar*) _tmp43_, _tmp44_, NULL);
			_tmp46_ = _tmp45_;
			archive_entry_set_pathname (_tmp42_, _tmp46_);
			_g_free0 (_tmp46_);
			_tmp47_ = ext;
			_tmp48_ = entry;
			r = (gssize) archive_write_header (_tmp47_, _tmp48_);
			if (r < ((gssize) ARCHIVE_OK)) {
				struct archive* _tmp49_;
				const gchar* _tmp50_;
				_tmp49_ = ext;
				_tmp50_ = archive_error_string (_tmp49_);
				g_warning ("filesystem.vala:108: Could not write archive entry: %s", _tmp50_);
				if (r < ((gssize) ARCHIVE_WARN)) {
					GSourceFunc _tmp51_;
					gpointer _tmp51__target;
					GDestroyNotify _tmp51__target_destroy_notify;
					_tmp51_ = _data68_->callback;
					_tmp51__target = _data68_->callback_target;
					_tmp51__target_destroy_notify = _data68_->callback_target_destroy_notify;
					_data68_->callback = NULL;
					_data68_->callback_target = NULL;
					_data68_->callback_target_destroy_notify = NULL;
					g_idle_add_full (G_PRIORITY_DEFAULT, _tmp51_, _tmp51__target, _tmp51__target_destroy_notify);
					_g_free0 (entry_path);
					_g_free0 (original_entry_path);
					_g_free0 (source_path);
					_g_free0 (archive_path);
					_archive_write_free0 (ext);
					_archive_read_free0 (archive);
					_g_free0 (extraction_location);
					return;
				}
			} else {
				struct archive_entry* _tmp52_;
				_tmp52_ = entry;
				if (archive_entry_size (_tmp52_) > ((la_int64_t) 0)) {
					struct archive* _tmp53_;
					struct archive* _tmp54_;
					_tmp53_ = archive;
					_tmp54_ = ext;
					r = proton_plus_utils_filesystem_copy_data (_tmp53_, _tmp54_, _data68_->cancellable);
					if (r < ((gssize) ARCHIVE_WARN)) {
						GSourceFunc _tmp55_;
						gpointer _tmp55__target;
						GDestroyNotify _tmp55__target_destroy_notify;
						_tmp55_ = _data68_->callback;
						_tmp55__target = _data68_->callback_target;
						_tmp55__target_destroy_notify = _data68_->callback_target_destroy_notify;
						_data68_->callback = NULL;
						_data68_->callback_target = NULL;
						_data68_->callback_target_destroy_notify = NULL;
						g_idle_add_full (G_PRIORITY_DEFAULT, _tmp55_, _tmp55__target, _tmp55__target_destroy_notify);
						_g_free0 (entry_path);
						_g_free0 (original_entry_path);
						_g_free0 (source_path);
						_g_free0 (archive_path);
						_archive_write_free0 (ext);
						_archive_read_free0 (archive);
						_g_free0 (extraction_location);
						return;
					}
				}
			}
			_tmp56_ = ext;
			r = (gssize) archive_write_finish_entry (_tmp56_);
			if (r < ((gssize) ARCHIVE_OK)) {
				struct archive* _tmp57_;
				const gchar* _tmp58_;
				_tmp57_ = ext;
				_tmp58_ = archive_error_string (_tmp57_);
				g_warning ("filesystem.vala:123: Could not finish archive entry: %s", _tmp58_);
			}
			if (r < ((gssize) ARCHIVE_WARN)) {
				GSourceFunc _tmp59_;
				gpointer _tmp59__target;
				GDestroyNotify _tmp59__target_destroy_notify;
				_tmp59_ = _data68_->callback;
				_tmp59__target = _data68_->callback_target;
				_tmp59__target_destroy_notify = _data68_->callback_target_destroy_notify;
				_data68_->callback = NULL;
				_data68_->callback_target = NULL;
				_data68_->callback_target_destroy_notify = NULL;
				g_idle_add_full (G_PRIORITY_DEFAULT, _tmp59_, _tmp59__target, _tmp59__target_destroy_notify);
				_g_free0 (entry_path);
				_g_free0 (original_entry_path);
				_g_free0 (source_path);
				_g_free0 (archive_path);
				_archive_write_free0 (ext);
				_archive_read_free0 (archive);
				_g_free0 (extraction_location);
				return;
			}
			_g_free0 (entry_path);
			_g_free0 (original_entry_path);
		}
	}
	_tmp60_ = archive;
	archive_read_close (_tmp60_);
	_tmp61_ = source_path;
	if (g_strcmp0 (_tmp61_, "") != 0) {
		const gchar* _tmp62_;
		gchar* _tmp63_;
		_tmp62_ = source_path;
		_tmp63_ = g_build_filename (_data68_->install_location, _tmp62_, NULL);
		_g_free0 (_data68_->output);
		_data68_->output = _tmp63_;
	}
	if (g_cancellable_is_cancelled (_data68_->cancellable)) {
		gchar* _tmp64_;
		_tmp64_ = g_strdup ("");
		_g_free0 (_data68_->output);
		_data68_->output = _tmp64_;
	}
	_tmp65_ = _data68_->callback;
	_tmp65__target = _data68_->callback_target;
	_tmp65__target_destroy_notify = _data68_->callback_target_destroy_notify;
	_data68_->callback = NULL;
	_data68_->callback_target = NULL;
	_data68_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp65_, _tmp65__target, _tmp65__target_destroy_notify);
	_g_free0 (source_path);
	_g_free0 (archive_path);
	_archive_write_free0 (ext);
	_archive_read_free0 (archive);
	_g_free0 (extraction_location);
}

static gpointer
___lambda4__gthread_func (gpointer self)
{
	gpointer result;
	__lambda4_ (self);
	result = NULL;
	block68_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_extract_co (ProtonPlusUtilsFilesystemExtractData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data68_ = g_slice_new0 (Block68Data);
	_data_->_data68_->_ref_count_ = 1;
	_g_free0 (_data_->_data68_->install_location);
	_data_->_data68_->install_location = _data_->install_location;
	_g_free0 (_data_->_data68_->tool_name);
	_data_->_data68_->tool_name = _data_->tool_name;
	_g_free0 (_data_->_data68_->extension);
	_data_->_data68_->extension = _data_->extension;
	_g_object_unref0 (_data_->_data68_->cancellable);
	_data_->_data68_->cancellable = _data_->cancellable;
	_data_->_data68_->_async_data_ = _data_;
	_data_->_data68_->callback = _proton_plus_utils_filesystem_extract_co_gsource_func;
	_data_->_data68_->callback_target = _data_;
	_data_->_data68_->callback_target_destroy_notify = NULL;
	_data_->_tmp0_ = g_strdup ("");
	_data_->_data68_->output = _data_->_tmp0_;
	_data_->_tmp1_ = g_thread_new ("extract", ___lambda4__gthread_func, block68_data_ref (_data_->_data68_));
	_data_->_tmp2_ = _data_->_tmp1_;
	_g_thread_unref0 (_data_->_tmp2_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp3_ = g_strdup (_data_->_data68_->output);
	_data_->result = _data_->_tmp3_;
	block68_data_unref (_data_->_data68_);
	_data_->_data68_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static 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*
proton_plus_utils_filesystem_normalize_archive_entry (const gchar* path)
{
	gboolean _tmp0_ = FALSE;
	gchar* normalized_path = NULL;
	gchar* _tmp1_;
	gboolean _tmp5_ = FALSE;
	const gchar* _tmp6_;
	const gchar* _tmp8_;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gchar* result;
	g_return_val_if_fail (path != NULL, NULL);
	if (g_strcmp0 (path, "") == 0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_path_is_absolute (path);
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp1_ = g_strdup (path);
	normalized_path = _tmp1_;
	while (TRUE) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = normalized_path;
		if (!g_str_has_prefix (_tmp2_, "./")) {
			break;
		}
		_tmp3_ = normalized_path;
		_tmp4_ = string_substring (_tmp3_, (glong) 2, (glong) -1);
		_g_free0 (normalized_path);
		normalized_path = _tmp4_;
	}
	_tmp6_ = normalized_path;
	if (g_strcmp0 (_tmp6_, "") == 0) {
		_tmp5_ = TRUE;
	} else {
		const gchar* _tmp7_;
		_tmp7_ = normalized_path;
		_tmp5_ = g_strcmp0 (_tmp7_, ".") == 0;
	}
	if (_tmp5_) {
		result = NULL;
		_g_free0 (normalized_path);
		return result;
	}
	_tmp8_ = normalized_path;
	_tmp10_ = _tmp9_ = g_strsplit (_tmp8_, "/", 0);
	{
		gchar** component_collection = NULL;
		gint component_collection_length1 = 0;
		gint _component_collection_size_ = 0;
		gint component_it = 0;
		component_collection = _tmp10_;
		component_collection_length1 = _vala_array_length (_tmp9_);
		for (component_it = 0; component_it < component_collection_length1; component_it = component_it + 1) {
			gchar* _tmp11_;
			gchar* component = NULL;
			_tmp11_ = g_strdup (component_collection[component_it]);
			component = _tmp11_;
			{
				const gchar* _tmp12_;
				_tmp12_ = component;
				if (g_strcmp0 (_tmp12_, "..") == 0) {
					result = NULL;
					_g_free0 (component);
					component_collection = (_vala_array_free (component_collection, component_collection_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (normalized_path);
					return result;
				}
				_g_free0 (component);
			}
		}
		component_collection = (_vala_array_free (component_collection, component_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = normalized_path;
	return result;
}

static guint8*
_vala_array_dup53 (guint8* self,
                   gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static gssize
proton_plus_utils_filesystem_copy_data (struct archive* ar,
                                        struct archive* aw,
                                        GCancellable* cancellable)
{
	gssize r = 0L;
	guint8* buffer = NULL;
	gint buffer_length1 = 0;
	gint _buffer_size_ = 0;
	la_int64_t offset = {0};
	gssize result;
	g_return_val_if_fail (ar != NULL, -1L);
	g_return_val_if_fail (aw != NULL, -1L);
	g_return_val_if_fail (cancellable != NULL, -1L);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = TRUE;
		while (TRUE) {
			guint8* _tmp1_ = NULL;
			size_t _tmp2_ = 0;
			la_int64_t _tmp3_ = {0};
			int _tmp4_;
			guint8* _tmp5_;
			gint _tmp5__length1;
			guint8* _tmp6_;
			gint _tmp6__length1;
			if (!_tmp0_) {
			}
			_tmp0_ = FALSE;
			if (g_cancellable_is_cancelled (cancellable)) {
				result = (gssize) ARCHIVE_FAILED;
				buffer = (g_free (buffer), NULL);
				return result;
			}
			_tmp4_ = archive_read_data_block (ar, &_tmp1_, &_tmp2_, &_tmp3_);
			buffer = (g_free (buffer), NULL);
			_tmp5_ = (_tmp1_ != NULL) ? _vala_array_dup53 (_tmp1_, _tmp2_) : _tmp1_;
			_tmp5__length1 = _tmp2_;
			buffer = _tmp5_;
			buffer_length1 = _tmp5__length1;
			_buffer_size_ = buffer_length1;
			offset = _tmp3_;
			r = (gssize) _tmp4_;
			if (r == ((gssize) ARCHIVE_EOF)) {
				result = (gssize) ARCHIVE_OK;
				buffer = (g_free (buffer), NULL);
				return result;
			}
			if (r < ((gssize) ARCHIVE_OK)) {
				result = r;
				buffer = (g_free (buffer), NULL);
				return result;
			}
			_tmp6_ = buffer;
			_tmp6__length1 = buffer_length1;
			r = archive_write_data_block (aw, _tmp6_, (size_t) _tmp6__length1, offset);
			if (r < ((gssize) ARCHIVE_OK)) {
				const gchar* _tmp7_;
				_tmp7_ = archive_error_string (aw);
				g_warning ("filesystem.vala:187: Could not write archive data: %s", _tmp7_);
				result = r;
				buffer = (g_free (buffer), NULL);
				return result;
			}
		}
	}
}

gchar*
proton_plus_utils_filesystem_convert_bytes_to_string (gint64 size)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_format_size_full ((guint64) size, G_FORMAT_SIZE_DEFAULT);
	result = _tmp0_;
	return result;
}

static void
proton_plus_utils_filesystem_make_symlink_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemMakeSymlinkData* _data_;
	_data_ = _data;
	_g_free0 (_data_->link_location);
	_g_free0 (_data_->target_path);
	g_slice_free (ProtonPlusUtilsFilesystemMakeSymlinkData, _data_);
}

void
proton_plus_utils_filesystem_make_symlink (const gchar* link_location,
                                           const gchar* target_path,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMakeSymlinkData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (link_location != NULL);
	g_return_if_fail (target_path != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemMakeSymlinkData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_make_symlink_data_free);
	_tmp0_ = g_strdup (link_location);
	_g_free0 (_data_->link_location);
	_data_->link_location = _tmp0_;
	_tmp1_ = g_strdup (target_path);
	_g_free0 (_data_->target_path);
	_data_->target_path = _tmp1_;
	proton_plus_utils_filesystem_make_symlink_co (_data_);
}

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

static void
proton_plus_utils_filesystem_make_symlink_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMakeSymlinkData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_make_symlink_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_make_symlink_co (ProtonPlusUtilsFilesystemMakeSymlinkData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_file_new_for_path (_data_->link_location);
	_data_->link_file = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->link_file;
	if (g_file_query_exists (_data_->_tmp1_, NULL)) {
		if (!g_file_test (_data_->link_location, G_FILE_TEST_IS_SYMLINK)) {
			_data_->result = FALSE;
			_g_object_unref0 (_data_->link_file);
			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_->link_deleted = proton_plus_utils_filesystem_delete_file (_data_->link_location);
		if (!_data_->link_deleted) {
			_data_->result = FALSE;
			_g_object_unref0 (_data_->link_file);
			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_->_tmp2_ = _data_->link_file;
		_data_->_state_ = 1;
		g_file_make_symbolic_link_async (_data_->_tmp2_, _data_->target_path, G_PRIORITY_DEFAULT, NULL, proton_plus_utils_filesystem_make_symlink_ready, _data_);
		return FALSE;
		_state_1:
		_data_->link_created = g_file_make_symbolic_link_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_data_->link_created) {
			_data_->result = FALSE;
			_g_object_unref0 (_data_->link_file);
			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;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->result = FALSE;
		_g_object_unref0 (_data_->link_file);
		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:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->link_file);
		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 = TRUE;
	_g_object_unref0 (_data_->link_file);
	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;
}

gchar*
proton_plus_utils_filesystem_get_file_content (const gchar* path,
                                               gboolean use_uri)
{
	gchar* output = NULL;
	gchar* _tmp0_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = g_strdup ("");
	output = _tmp0_;
	{
		GFile* file = NULL;
		guint8* contents = NULL;
		gint contents_length1 = 0;
		gint _contents_size_ = 0;
		gchar* etag_out = NULL;
		GFile* _tmp3_;
		guint8* _tmp4_ = NULL;
		gsize _tmp5_ = 0;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_;
		if (use_uri) {
			GFile* _tmp1_;
			_tmp1_ = g_file_new_for_uri (path);
			_g_object_unref0 (file);
			file = _tmp1_;
		} else {
			GFile* _tmp2_;
			_tmp2_ = g_file_new_for_path (path);
			_g_object_unref0 (file);
			file = _tmp2_;
		}
		_tmp3_ = file;
		g_file_load_contents (_tmp3_, NULL, &_tmp4_, &_tmp5_, &_tmp6_, &_inner_error0_);
		contents = (g_free (contents), NULL);
		contents = _tmp4_;
		contents_length1 = _tmp5_;
		_contents_size_ = contents_length1;
		_g_free0 (etag_out);
		etag_out = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (etag_out);
			contents = (g_free (contents), NULL);
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		_tmp7_ = proton_plus_utils_parser_data_to_string (contents, (gint) contents_length1);
		_g_free0 (output);
		output = _tmp7_;
		_g_free0 (etag_out);
		contents = (g_free (contents), NULL);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("filesystem.vala:242: %s", _tmp9_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (output);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = output;
	return result;
}

static void
proton_plus_utils_filesystem_get_file_content_async_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemGetFileContentAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->path);
	_g_free0 (_data_->result);
	g_slice_free (ProtonPlusUtilsFilesystemGetFileContentAsyncData, _data_);
}

void
proton_plus_utils_filesystem_get_file_content_async (const gchar* path,
                                                     gboolean use_uri,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemGetFileContentAsyncData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (path != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemGetFileContentAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_get_file_content_async_data_free);
	_tmp0_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp0_;
	_data_->use_uri = use_uri;
	proton_plus_utils_filesystem_get_file_content_async_co (_data_);
}

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

static void
proton_plus_utils_filesystem_get_file_content_async_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemGetFileContentAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_get_file_content_async_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_get_file_content_async_co (ProtonPlusUtilsFilesystemGetFileContentAsyncData* _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_;
	{
		if (_data_->use_uri) {
			_data_->_tmp1_ = g_file_new_for_uri (_data_->path);
			_g_object_unref0 (_data_->file);
			_data_->file = _data_->_tmp1_;
		} else {
			_data_->_tmp2_ = g_file_new_for_path (_data_->path);
			_g_object_unref0 (_data_->file);
			_data_->file = _data_->_tmp2_;
		}
		_data_->contents_length1 = 0;
		_data_->_contents_size_ = 0;
		_data_->_tmp3_ = _data_->file;
		_data_->_tmp4_ = NULL;
		_data_->_tmp5_ = 0;
		_data_->_tmp6_ = NULL;
		_data_->_state_ = 1;
		g_file_load_contents_async (_data_->_tmp3_, NULL, proton_plus_utils_filesystem_get_file_content_async_ready, _data_);
		return FALSE;
		_state_1:
		g_file_load_contents_finish (_data_->_tmp3_, _data_->_res_, &_data_->_tmp4_, &_data_->_tmp5_, &_data_->_tmp6_, &_data_->_inner_error0_);
		_data_->contents = (g_free (_data_->contents), NULL);
		_data_->contents = _data_->_tmp4_;
		_data_->contents_length1 = _data_->_tmp5_;
		_data_->_contents_size_ = _data_->contents_length1;
		_g_free0 (_data_->etag_out);
		_data_->etag_out = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->etag_out);
			_data_->contents = (g_free (_data_->contents), NULL);
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		_data_->_tmp7_ = proton_plus_utils_parser_data_to_string (_data_->contents, (gint) _data_->contents_length1);
		_g_free0 (_data_->output);
		_data_->output = _data_->_tmp7_;
		_g_free0 (_data_->etag_out);
		_data_->contents = (g_free (_data_->contents), NULL);
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("filesystem.vala:266: %s", _data_->_tmp9_);
		_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;
}

gboolean
proton_plus_utils_filesystem_modify_file (const gchar* path,
                                          const gchar* content)
{
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (content != NULL, FALSE);
	{
		g_file_set_contents (path, content, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp0_ = FALSE;
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_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 _tmp0_;
		}
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("filesystem.vala:276: %s", _tmp2_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		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 _tmp3_;
	}
	_tmp4_ = proton_plus_utils_filesystem_get_file_content (path, FALSE);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strcmp0 (_tmp5_, content) == 0;
	_g_free0 (_tmp5_);
	result = _tmp6_;
	return result;
}

gboolean
proton_plus_utils_filesystem_copy_symlink (const gchar* src_path,
                                           const gchar* dest_path)
{
	gboolean _tmp5_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (src_path != NULL, FALSE);
	g_return_val_if_fail (dest_path != NULL, FALSE);
	{
		GFile* src = NULL;
		GFile* _tmp0_;
		GFile* dest = NULL;
		GFile* _tmp1_;
		gboolean _tmp2_ = FALSE;
		_tmp0_ = g_file_new_for_path (src_path);
		src = _tmp0_;
		_tmp1_ = g_file_new_for_path (dest_path);
		dest = _tmp1_;
		_tmp2_ = g_file_copy (src, dest, G_FILE_COPY_NOFOLLOW_SYMLINKS, NULL, NULL, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (dest);
			_g_object_unref0 (src);
			goto __catch0_g_error;
		}
		result = _tmp2_;
		_g_object_unref0 (dest);
		_g_object_unref0 (src);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("filesystem.vala:291: %s", _tmp4_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return _tmp5_;
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

void
proton_plus_utils_filesystem_create_file (const gchar* path,
                                          const gchar* content,
                                          gboolean private_mode)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (path != NULL);
	{
		GFile* file = NULL;
		GFile* _tmp0_;
		GFileCreateFlags _tmp1_ = 0U;
		GFileOutputStream* os = NULL;
		GFile* _tmp2_;
		GFileOutputStream* _tmp3_;
		_tmp0_ = g_file_parse_name (path);
		file = _tmp0_;
		if (private_mode) {
			_tmp1_ = G_FILE_CREATE_PRIVATE;
		} else {
			_tmp1_ = G_FILE_CREATE_NONE;
		}
		_tmp2_ = file;
		_tmp3_ = g_file_create (_tmp2_, _tmp1_, NULL, &_inner_error0_);
		os = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		if (content != NULL) {
			GFileOutputStream* _tmp4_;
			guint8* _tmp5_;
			gint _tmp5__length1;
			gint _tmp6_ = 0;
			guint8* _tmp7_;
			gint _tmp7__length1;
			_tmp4_ = os;
			_tmp5_ = string_get_data (content, &_tmp6_);
			_tmp5__length1 = _tmp6_;
			_tmp7_ = _tmp5_;
			_tmp7__length1 = _tmp5__length1;
			g_output_stream_write ((GOutputStream*) _tmp4_, _tmp7_, (gsize) _tmp7__length1, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (os);
				_g_object_unref0 (file);
				goto __catch0_g_error;
			}
		}
		_g_object_unref0 (os);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("filesystem.vala:306: %s", _tmp9_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static gboolean
proton_plus_utils_filesystem_delete_file_direct (const gchar* path)
{
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	result = unlink (path) == 0;
	return result;
}

gboolean
proton_plus_utils_filesystem_delete_file (const gchar* path)
{
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	result = proton_plus_utils_filesystem_delete_file_direct (path);
	return result;
}

gchar*
proton_plus_utils_filesystem_create_temporary_directory (const gchar* parent,
                                                         const gchar* prefix)
{
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (prefix != NULL, NULL);
	if (!g_file_test (parent, G_FILE_TEST_IS_DIR)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("");
		result = _tmp0_;
		return result;
	}
	_tmp1_ = g_strdup_printf ("%sXXXXXX", prefix);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_build_filename (parent, _tmp2_, NULL);
	_tmp4_ = mkdtemp (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp2_);
	result = _tmp5_;
	return result;
}

static void
proton_plus_utils_filesystem_move_directory_atomic_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemMoveDirectoryAtomicData* _data_;
	_data_ = _data;
	g_slice_free (ProtonPlusUtilsFilesystemMoveDirectoryAtomicData, _data_);
}

void
proton_plus_utils_filesystem_move_directory_atomic (const gchar* source,
                                                    const gchar* destination,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMoveDirectoryAtomicData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemMoveDirectoryAtomicData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_move_directory_atomic_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_move_directory_atomic_co (_data_);
}

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

static Block69Data*
block69_data_ref (Block69Data* _data69_)
{
	g_atomic_int_inc (&_data69_->_ref_count_);
	return _data69_;
}

static void
block69_data_unref (void * _userdata_)
{
	Block69Data* _data69_;
	_data69_ = (Block69Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data69_->_ref_count_)) {
		(_data69_->callback_target_destroy_notify == NULL) ? NULL : (_data69_->callback_target_destroy_notify (_data69_->callback_target), NULL);
		_data69_->callback = NULL;
		_data69_->callback_target = NULL;
		_data69_->callback_target_destroy_notify = NULL;
		_g_free0 (_data69_->source);
		_g_free0 (_data69_->destination);
		g_slice_free (Block69Data, _data69_);
	}
}

static gboolean
_proton_plus_utils_filesystem_move_directory_atomic_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_move_directory_atomic_co (self);
	return result;
}

static void
__lambda5_ (Block69Data* _data69_)
{
	gboolean _tmp0_ = FALSE;
	GSourceFunc _tmp2_;
	gpointer _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	if (!g_file_test (_data69_->source, G_FILE_TEST_IS_DIR)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_file_test (_data69_->destination, G_FILE_TEST_EXISTS);
	}
	if (_tmp0_) {
		GSourceFunc _tmp1_;
		gpointer _tmp1__target;
		GDestroyNotify _tmp1__target_destroy_notify;
		_tmp1_ = _data69_->callback;
		_tmp1__target = _data69_->callback_target;
		_tmp1__target_destroy_notify = _data69_->callback_target_destroy_notify;
		_data69_->callback = NULL;
		_data69_->callback_target = NULL;
		_data69_->callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify);
		return;
	}
	_data69_->output = g_rename (_data69_->source, _data69_->destination) == 0;
	_tmp2_ = _data69_->callback;
	_tmp2__target = _data69_->callback_target;
	_tmp2__target_destroy_notify = _data69_->callback_target_destroy_notify;
	_data69_->callback = NULL;
	_data69_->callback_target = NULL;
	_data69_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
}

static gpointer
___lambda5__gthread_func (gpointer self)
{
	gpointer result;
	__lambda5_ (self);
	result = NULL;
	block69_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_move_directory_atomic_co (ProtonPlusUtilsFilesystemMoveDirectoryAtomicData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data69_ = g_slice_new0 (Block69Data);
	_data_->_data69_->_ref_count_ = 1;
	_g_free0 (_data_->_data69_->source);
	_data_->_data69_->source = _data_->source;
	_g_free0 (_data_->_data69_->destination);
	_data_->_data69_->destination = _data_->destination;
	_data_->_data69_->_async_data_ = _data_;
	_data_->_data69_->callback = _proton_plus_utils_filesystem_move_directory_atomic_co_gsource_func;
	_data_->_data69_->callback_target = _data_;
	_data_->_data69_->callback_target_destroy_notify = NULL;
	_data_->_data69_->output = FALSE;
	_data_->_tmp0_ = g_thread_new ("move_directory_atomic", ___lambda5__gthread_func, block69_data_ref (_data_->_data69_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data69_->output;
	block69_data_unref (_data_->_data69_);
	_data_->_data69_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_utils_filesystem_move_file_atomic_if_absent_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData* _data_;
	_data_ = _data;
	g_slice_free (ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData, _data_);
}

void
proton_plus_utils_filesystem_move_file_atomic_if_absent (const gchar* source,
                                                         const gchar* destination,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_move_file_atomic_if_absent_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_move_file_atomic_if_absent_co (_data_);
}

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

static Block70Data*
block70_data_ref (Block70Data* _data70_)
{
	g_atomic_int_inc (&_data70_->_ref_count_);
	return _data70_;
}

static void
block70_data_unref (void * _userdata_)
{
	Block70Data* _data70_;
	_data70_ = (Block70Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data70_->_ref_count_)) {
		(_data70_->callback_target_destroy_notify == NULL) ? NULL : (_data70_->callback_target_destroy_notify (_data70_->callback_target), NULL);
		_data70_->callback = NULL;
		_data70_->callback_target = NULL;
		_data70_->callback_target_destroy_notify = NULL;
		_g_free0 (_data70_->source);
		_g_free0 (_data70_->destination);
		g_slice_free (Block70Data, _data70_);
	}
}

static gboolean
_proton_plus_utils_filesystem_move_file_atomic_if_absent_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_move_file_atomic_if_absent_co (self);
	return result;
}

static void
__lambda6_ (Block70Data* _data70_)
{
	gboolean _tmp0_ = FALSE;
	GSourceFunc _tmp2_;
	gpointer _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	if (!g_file_test (_data70_->source, G_FILE_TEST_IS_REGULAR)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_file_test (_data70_->destination, G_FILE_TEST_EXISTS);
	}
	if (_tmp0_) {
		GSourceFunc _tmp1_;
		gpointer _tmp1__target;
		GDestroyNotify _tmp1__target_destroy_notify;
		_tmp1_ = _data70_->callback;
		_tmp1__target = _data70_->callback_target;
		_tmp1__target_destroy_notify = _data70_->callback_target_destroy_notify;
		_data70_->callback = NULL;
		_data70_->callback_target = NULL;
		_data70_->callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify);
		return;
	}
	_data70_->output = g_rename (_data70_->source, _data70_->destination) == 0;
	_tmp2_ = _data70_->callback;
	_tmp2__target = _data70_->callback_target;
	_tmp2__target_destroy_notify = _data70_->callback_target_destroy_notify;
	_data70_->callback = NULL;
	_data70_->callback_target = NULL;
	_data70_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
}

static gpointer
___lambda6__gthread_func (gpointer self)
{
	gpointer result;
	__lambda6_ (self);
	result = NULL;
	block70_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_move_file_atomic_if_absent_co (ProtonPlusUtilsFilesystemMoveFileAtomicIfAbsentData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data70_ = g_slice_new0 (Block70Data);
	_data_->_data70_->_ref_count_ = 1;
	_g_free0 (_data_->_data70_->source);
	_data_->_data70_->source = _data_->source;
	_g_free0 (_data_->_data70_->destination);
	_data_->_data70_->destination = _data_->destination;
	_data_->_data70_->_async_data_ = _data_;
	_data_->_data70_->callback = _proton_plus_utils_filesystem_move_file_atomic_if_absent_co_gsource_func;
	_data_->_data70_->callback_target = _data_;
	_data_->_data70_->callback_target_destroy_notify = NULL;
	_data_->_data70_->output = FALSE;
	_data_->_tmp0_ = g_thread_new ("move_file_atomic", ___lambda6__gthread_func, block70_data_ref (_data_->_data70_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data70_->output;
	block70_data_unref (_data_->_data70_);
	_data_->_data70_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_utils_filesystem_copy_file_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemCopyFileData* _data_;
	_data_ = _data;
	_g_free0 (_data_->source);
	_g_free0 (_data_->destination);
	g_slice_free (ProtonPlusUtilsFilesystemCopyFileData, _data_);
}

void
proton_plus_utils_filesystem_copy_file (const gchar* source,
                                        const gchar* destination,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyFileData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemCopyFileData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_copy_file_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_copy_file_co (_data_);
}

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

static void
proton_plus_utils_filesystem_copy_file_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_copy_file_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_copy_file_co (ProtonPlusUtilsFilesystemCopyFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = g_file_parse_name (_data_->source);
		_data_->source_file = _data_->_tmp0_;
		_data_->_tmp1_ = g_file_parse_name (_data_->destination);
		_data_->destination_file = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->source_file;
		if (!g_file_query_exists (_data_->_tmp2_, NULL)) {
			_data_->result = FALSE;
			_g_object_unref0 (_data_->destination_file);
			_g_object_unref0 (_data_->source_file);
			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_->source_file;
		_data_->_tmp4_ = _data_->destination_file;
		_data_->_state_ = 1;
		g_file_copy_async (_data_->_tmp3_, _data_->_tmp4_, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, NULL, NULL, NULL, proton_plus_utils_filesystem_copy_file_ready, _data_);
		return FALSE;
		_state_1:
		g_file_copy_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->destination_file);
			_g_object_unref0 (_data_->source_file);
			goto __catch0_g_error;
		}
		_data_->result = TRUE;
		_g_object_unref0 (_data_->destination_file);
		_g_object_unref0 (_data_->source_file);
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp5_ = _data_->e;
		_data_->_tmp6_ = _data_->_tmp5_->message;
		g_warning ("filesystem.vala:384: Failed to copy %s: %s", _data_->source, _data_->_tmp6_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->e);
		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:
	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_utils_filesystem_copy_file_verified_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemCopyFileVerifiedData* _data_;
	_data_ = _data;
	_g_free0 (_data_->source);
	_g_free0 (_data_->destination);
	g_slice_free (ProtonPlusUtilsFilesystemCopyFileVerifiedData, _data_);
}

void
proton_plus_utils_filesystem_copy_file_verified (const gchar* source,
                                                 const gchar* destination,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyFileVerifiedData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemCopyFileVerifiedData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_copy_file_verified_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_copy_file_verified_co (_data_);
}

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

static void
proton_plus_utils_filesystem_copy_file_verified_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyFileVerifiedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_copy_file_verified_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_copy_file_verified_co (ProtonPlusUtilsFilesystemCopyFileVerifiedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	proton_plus_utils_filesystem_copy_file (_data_->source, _data_->destination, proton_plus_utils_filesystem_copy_file_verified_ready, _data_);
	return FALSE;
	_state_1:
	if (!proton_plus_utils_filesystem_copy_file_finish (_data_->_res_)) {
		_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_->source_contents_length1 = 0;
		_data_->_source_contents_size_ = 0;
		_data_->destination_contents_length1 = 0;
		_data_->_destination_contents_size_ = 0;
		_data_->_tmp0_ = g_file_parse_name (_data_->source);
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp2_ = NULL;
		_data_->_tmp3_ = 0;
		_data_->_tmp4_ = NULL;
		_data_->_state_ = 2;
		g_file_load_contents_async (_data_->_tmp1_, NULL, proton_plus_utils_filesystem_copy_file_verified_ready, _data_);
		return FALSE;
		_state_2:
		g_file_load_contents_finish (_data_->_tmp1_, _data_->_res_, &_data_->_tmp2_, &_data_->_tmp3_, &_data_->_tmp4_, &_data_->_inner_error0_);
		_data_->source_contents = (g_free (_data_->source_contents), NULL);
		_data_->source_contents = _data_->_tmp2_;
		_data_->source_contents_length1 = _data_->_tmp3_;
		_data_->_source_contents_size_ = _data_->source_contents_length1;
		_g_free0 (_data_->source_etag);
		_data_->source_etag = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp1_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->destination_etag);
			_g_free0 (_data_->source_etag);
			_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
			_data_->source_contents = (g_free (_data_->source_contents), NULL);
			goto __catch0_g_error;
		}
		_data_->_tmp5_ = g_file_parse_name (_data_->destination);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = NULL;
		_data_->_tmp8_ = 0;
		_data_->_tmp9_ = NULL;
		_data_->_state_ = 3;
		g_file_load_contents_async (_data_->_tmp6_, NULL, proton_plus_utils_filesystem_copy_file_verified_ready, _data_);
		return FALSE;
		_state_3:
		g_file_load_contents_finish (_data_->_tmp6_, _data_->_res_, &_data_->_tmp7_, &_data_->_tmp8_, &_data_->_tmp9_, &_data_->_inner_error0_);
		_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
		_data_->destination_contents = _data_->_tmp7_;
		_data_->destination_contents_length1 = _data_->_tmp8_;
		_data_->_destination_contents_size_ = _data_->destination_contents_length1;
		_g_free0 (_data_->destination_etag);
		_data_->destination_etag = _data_->_tmp9_;
		_g_object_unref0 (_data_->_tmp6_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->destination_etag);
			_g_free0 (_data_->source_etag);
			_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
			_data_->source_contents = (g_free (_data_->source_contents), NULL);
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = _data_->source_contents;
		_data_->_tmp10__length1 = _data_->source_contents_length1;
		_data_->_tmp11_ = _data_->destination_contents;
		_data_->_tmp11__length1 = _data_->destination_contents_length1;
		if (_data_->_tmp10__length1 == _data_->_tmp11__length1) {
			{
				_data_->index = 0;
				{
					_data_->_tmp12_ = TRUE;
					while (TRUE) {
						if (!_data_->_tmp12_) {
							_data_->_tmp13_ = _data_->index;
							_data_->index = _data_->_tmp13_ + 1;
						}
						_data_->_tmp12_ = FALSE;
						_data_->_tmp14_ = _data_->source_contents;
						_data_->_tmp14__length1 = _data_->source_contents_length1;
						if (!(_data_->index < _data_->_tmp14__length1)) {
							break;
						}
						_data_->_tmp15_ = _data_->source_contents;
						_data_->_tmp15__length1 = _data_->source_contents_length1;
						_data_->_tmp16_ = _data_->_tmp15_[_data_->index];
						_data_->_tmp17_ = _data_->destination_contents;
						_data_->_tmp17__length1 = _data_->destination_contents_length1;
						_data_->_tmp18_ = _data_->_tmp17_[_data_->index];
						if (_data_->_tmp16_ != _data_->_tmp18_) {
							g_warning ("filesystem.vala:408: Copied file verification failed: %s", _data_->destination);
							_data_->result = FALSE;
							_g_free0 (_data_->destination_etag);
							_g_free0 (_data_->source_etag);
							_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
							_data_->source_contents = (g_free (_data_->source_contents), 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;
						}
					}
				}
			}
			_data_->result = TRUE;
			_g_free0 (_data_->destination_etag);
			_g_free0 (_data_->source_etag);
			_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
			_data_->source_contents = (g_free (_data_->source_contents), 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_warning ("filesystem.vala:415: Copied file verification failed: %s", _data_->destination);
		_g_free0 (_data_->destination_etag);
		_g_free0 (_data_->source_etag);
		_data_->destination_contents = (g_free (_data_->destination_contents), NULL);
		_data_->source_contents = (g_free (_data_->source_contents), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp19_ = _data_->e;
		_data_->_tmp20_ = _data_->_tmp19_->message;
		g_warning ("filesystem.vala:417: Failed to verify copied file %s: %s", _data_->destination, _data_->_tmp20_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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 = 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;
}

static void
proton_plus_utils_filesystem_move_directory_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemMoveDirectoryData* _data_;
	_data_ = _data;
	_g_free0 (_data_->source);
	_g_free0 (_data_->destination);
	g_slice_free (ProtonPlusUtilsFilesystemMoveDirectoryData, _data_);
}

void
proton_plus_utils_filesystem_move_directory (const gchar* source,
                                             const gchar* destination,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMoveDirectoryData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemMoveDirectoryData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_move_directory_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_move_directory_co (_data_);
}

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

static void
proton_plus_utils_filesystem_move_directory_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMoveDirectoryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_move_directory_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_move_directory_co (ProtonPlusUtilsFilesystemMoveDirectoryData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->destination_existed = g_file_test (_data_->destination, G_FILE_TEST_EXISTS);
	_data_->_state_ = 1;
	proton_plus_utils_filesystem_copy_directory (_data_->source, _data_->destination, proton_plus_utils_filesystem_move_directory_ready, _data_);
	return FALSE;
	_state_1:
	_data_->copied = proton_plus_utils_filesystem_copy_directory_finish (_data_->_res_);
	if (!_data_->copied) {
		if (!_data_->destination_existed) {
			_data_->_tmp0_ = g_file_test (_data_->destination, G_FILE_TEST_IS_DIR);
		} else {
			_data_->_tmp0_ = FALSE;
		}
		if (_data_->_tmp0_) {
			_data_->_state_ = 2;
			proton_plus_utils_filesystem_delete_directory (_data_->destination, proton_plus_utils_filesystem_move_directory_ready, _data_);
			return FALSE;
			_state_2:
			proton_plus_utils_filesystem_delete_directory_finish (_data_->_res_);
		}
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 3;
	proton_plus_utils_filesystem_delete_directory (_data_->source, proton_plus_utils_filesystem_move_directory_ready, _data_);
	return FALSE;
	_state_3:
	_data_->result = proton_plus_utils_filesystem_delete_directory_finish (_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;
}

static void
proton_plus_utils_filesystem_copy_directory_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemCopyDirectoryData* _data_;
	_data_ = _data;
	_g_free0 (_data_->source);
	_g_free0 (_data_->destination);
	g_slice_free (ProtonPlusUtilsFilesystemCopyDirectoryData, _data_);
}

void
proton_plus_utils_filesystem_copy_directory (const gchar* source,
                                             const gchar* destination,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyDirectoryData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemCopyDirectoryData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_copy_directory_data_free);
	_tmp0_ = g_strdup (source);
	_g_free0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = g_strdup (destination);
	_g_free0 (_data_->destination);
	_data_->destination = _tmp1_;
	proton_plus_utils_filesystem_copy_directory_co (_data_);
}

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

static void
proton_plus_utils_filesystem_copy_directory_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCopyDirectoryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_utils_filesystem_copy_directory_co (_data_);
}

static gboolean
proton_plus_utils_filesystem_copy_directory_co (ProtonPlusUtilsFilesystemCopyDirectoryData* _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:
	{
		_data_->_tmp0_ = g_file_parse_name (_data_->source);
		_data_->src = _data_->_tmp0_;
		_data_->_tmp1_ = g_file_parse_name (_data_->destination);
		_data_->dest = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->src;
		if (!g_file_query_exists (_data_->_tmp2_, NULL)) {
			g_warning ("filesystem.vala:444: Source directory does not exist: %s", _data_->source);
			_data_->result = FALSE;
			_g_object_unref0 (_data_->dest);
			_g_object_unref0 (_data_->src);
			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_->dest;
		if (!g_file_query_exists (_data_->_tmp3_, NULL)) {
			_data_->_tmp4_ = _data_->dest;
			_data_->_state_ = 1;
			g_file_make_directory_async (_data_->_tmp4_, G_PRIORITY_DEFAULT, NULL, proton_plus_utils_filesystem_copy_directory_ready, _data_);
			return FALSE;
			_state_1:
			g_file_make_directory_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->dest);
				_g_object_unref0 (_data_->src);
				goto __catch0_g_error;
			}
		}
		_data_->_tmp5_ = _data_->src;
		_data_->_state_ = 2;
		g_file_enumerate_children_async (_data_->_tmp5_, "standard::*", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, G_PRIORITY_DEFAULT, NULL, proton_plus_utils_filesystem_copy_directory_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp6_ = g_file_enumerate_children_finish (_data_->_tmp5_, _data_->_res_, &_data_->_inner_error0_);
		_data_->enumerator = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->dest);
			_g_object_unref0 (_data_->src);
			goto __catch0_g_error;
		}
		while (TRUE) {
			_data_->_tmp8_ = _data_->enumerator;
			_data_->_tmp9_ = g_file_enumerator_next_file (_data_->_tmp8_, NULL, &_data_->_inner_error0_);
			_data_->_tmp7_ = _data_->_tmp9_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file_info);
				_g_object_unref0 (_data_->enumerator);
				_g_object_unref0 (_data_->dest);
				_g_object_unref0 (_data_->src);
				goto __catch0_g_error;
			}
			_data_->_tmp10_ = _data_->_tmp7_;
			_data_->_tmp7_ = NULL;
			_g_object_unref0 (_data_->file_info);
			_data_->file_info = _data_->_tmp10_;
			_data_->_tmp11_ = _data_->file_info;
			if (!(_data_->_tmp11_ != NULL)) {
				_g_object_unref0 (_data_->_tmp7_);
				break;
			}
			_data_->_tmp12_ = _data_->file_info;
			_data_->_tmp13_ = g_file_info_get_name (_data_->_tmp12_);
			_data_->_tmp14_ = g_strdup (_data_->_tmp13_);
			_data_->file_name = _data_->_tmp14_;
			_data_->_tmp15_ = _data_->src;
			_data_->_tmp16_ = _data_->file_name;
			_data_->_tmp17_ = g_file_get_child (_data_->_tmp15_, _data_->_tmp16_);
			_data_->src_file = _data_->_tmp17_;
			_data_->_tmp18_ = _data_->dest;
			_data_->_tmp19_ = _data_->file_name;
			_data_->_tmp20_ = g_file_get_child (_data_->_tmp18_, _data_->_tmp19_);
			_data_->dest_file = _data_->_tmp20_;
			_data_->_tmp21_ = _data_->file_info;
			if (g_file_info_get_file_type (_data_->_tmp21_) == G_FILE_TYPE_DIRECTORY) {
				_data_->_tmp22_ = _data_->src_file;
				_data_->_tmp23_ = g_file_get_path (_data_->_tmp22_);
				_data_->_tmp24_ = _data_->_tmp23_;
				_data_->_tmp25_ = _data_->dest_file;
				_data_->_tmp26_ = g_file_get_path (_data_->_tmp25_);
				_data_->_tmp27_ = _data_->_tmp26_;
				_data_->_state_ = 3;
				proton_plus_utils_filesystem_copy_directory (_data_->_tmp24_, _data_->_tmp27_, proton_plus_utils_filesystem_copy_directory_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp28_ = !proton_plus_utils_filesystem_copy_directory_finish (_data_->_res_);
				_g_free0 (_data_->_tmp27_);
				_g_free0 (_data_->_tmp24_);
				if (_data_->_tmp28_) {
					_data_->result = FALSE;
					_g_object_unref0 (_data_->dest_file);
					_g_object_unref0 (_data_->src_file);
					_g_free0 (_data_->file_name);
					_g_object_unref0 (_data_->_tmp7_);
					_g_object_unref0 (_data_->file_info);
					_g_object_unref0 (_data_->enumerator);
					_g_object_unref0 (_data_->dest);
					_g_object_unref0 (_data_->src);
					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 {
				{
					_data_->_tmp29_ = _data_->src_file;
					_data_->_tmp30_ = _data_->dest_file;
					_data_->_state_ = 4;
					g_file_copy_async (_data_->_tmp29_, _data_->_tmp30_, G_FILE_COPY_NOFOLLOW_SYMLINKS, G_PRIORITY_DEFAULT, NULL, NULL, NULL, proton_plus_utils_filesystem_copy_directory_ready, _data_);
					return FALSE;
					_state_4:
					g_file_copy_finish (_data_->_tmp29_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch1_g_error;
					}
				}
				goto __finally1;
				__catch1_g_error:
				{
					_data_->e = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp31_ = _data_->file_name;
					_data_->_tmp32_ = _data_->e;
					_data_->_tmp33_ = _data_->_tmp32_->message;
					g_warning ("filesystem.vala:473: Failed to copy %s: %s\n", _data_->_tmp31_, _data_->_tmp33_);
					_data_->result = FALSE;
					_g_error_free0 (_data_->e);
					_g_object_unref0 (_data_->dest_file);
					_g_object_unref0 (_data_->src_file);
					_g_free0 (_data_->file_name);
					_g_object_unref0 (_data_->_tmp7_);
					_g_object_unref0 (_data_->file_info);
					_g_object_unref0 (_data_->enumerator);
					_g_object_unref0 (_data_->dest);
					_g_object_unref0 (_data_->src);
					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;
				}
				__finally1:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_object_unref0 (_data_->dest_file);
					_g_object_unref0 (_data_->src_file);
					_g_free0 (_data_->file_name);
					_g_object_unref0 (_data_->_tmp7_);
					_g_object_unref0 (_data_->file_info);
					_g_object_unref0 (_data_->enumerator);
					_g_object_unref0 (_data_->dest);
					_g_object_unref0 (_data_->src);
					goto __catch0_g_error;
				}
			}
			_g_object_unref0 (_data_->dest_file);
			_g_object_unref0 (_data_->src_file);
			_g_free0 (_data_->file_name);
			_g_object_unref0 (_data_->_tmp7_);
		}
		_g_object_unref0 (_data_->file_info);
		_g_object_unref0 (_data_->enumerator);
		_g_object_unref0 (_data_->dest);
		_g_object_unref0 (_data_->src);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_vala1_e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp34_ = _data_->_vala1_e;
		_data_->_tmp35_ = _data_->_tmp34_->message;
		g_warning ("filesystem.vala:479: %s", _data_->_tmp35_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->_vala1_e);
		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:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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 = 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_utils_filesystem_move_dir_contents_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemMoveDirContentsData* _data_;
	_data_ = _data;
	g_slice_free (ProtonPlusUtilsFilesystemMoveDirContentsData, _data_);
}

void
proton_plus_utils_filesystem_move_dir_contents (const gchar* source_dir,
                                                const gchar* target_dir,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemMoveDirContentsData* _data_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (source_dir != NULL);
	g_return_if_fail (target_dir != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemMoveDirContentsData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_move_dir_contents_data_free);
	_tmp0_ = g_strdup (source_dir);
	_g_free0 (_data_->source_dir);
	_data_->source_dir = _tmp0_;
	_tmp1_ = g_strdup (target_dir);
	_g_free0 (_data_->target_dir);
	_data_->target_dir = _tmp1_;
	proton_plus_utils_filesystem_move_dir_contents_co (_data_);
}

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

static Block71Data*
block71_data_ref (Block71Data* _data71_)
{
	g_atomic_int_inc (&_data71_->_ref_count_);
	return _data71_;
}

static void
block71_data_unref (void * _userdata_)
{
	Block71Data* _data71_;
	_data71_ = (Block71Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data71_->_ref_count_)) {
		(_data71_->callback_target_destroy_notify == NULL) ? NULL : (_data71_->callback_target_destroy_notify (_data71_->callback_target), NULL);
		_data71_->callback = NULL;
		_data71_->callback_target = NULL;
		_data71_->callback_target_destroy_notify = NULL;
		_g_free0 (_data71_->source_dir);
		_g_free0 (_data71_->target_dir);
		g_slice_free (Block71Data, _data71_);
	}
}

static gboolean
_proton_plus_utils_filesystem_move_dir_contents_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_move_dir_contents_co (self);
	return result;
}

static void
__lambda8_ (Block71Data* _data71_)
{
	GSourceFunc _tmp14_;
	gpointer _tmp14__target;
	GDestroyNotify _tmp14__target_destroy_notify;
	GError* _inner_error0_ = NULL;
	{
		GDir* dir = NULL;
		GDir* _tmp0_;
		gchar* name = NULL;
		_tmp0_ = g_dir_open (_data71_->source_dir, (guint) 0, &_inner_error0_);
		dir = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		name = NULL;
		_data71_->output = TRUE;
		while (TRUE) {
			GDir* _tmp1_;
			const gchar* _tmp2_;
			gchar* _tmp3_;
			const gchar* _tmp4_;
			gchar* source_path = NULL;
			const gchar* _tmp5_;
			gchar* _tmp6_;
			gchar* target_path = NULL;
			const gchar* _tmp7_;
			gchar* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp1_ = dir;
			_tmp2_ = g_dir_read_name (_tmp1_);
			_tmp3_ = g_strdup (_tmp2_);
			_g_free0 (name);
			name = _tmp3_;
			_tmp4_ = name;
			if (!(_tmp4_ != NULL)) {
				break;
			}
			_tmp5_ = name;
			_tmp6_ = g_build_filename (_data71_->source_dir, _tmp5_, NULL);
			source_path = _tmp6_;
			_tmp7_ = name;
			_tmp8_ = g_build_filename (_data71_->target_dir, _tmp7_, NULL);
			target_path = _tmp8_;
			_tmp9_ = target_path;
			if (g_file_test (_tmp9_, G_FILE_TEST_EXISTS)) {
				_data71_->output = FALSE;
				_g_free0 (target_path);
				_g_free0 (source_path);
				break;
			}
			_tmp10_ = source_path;
			_tmp11_ = target_path;
			if (g_rename (_tmp10_, _tmp11_) != 0) {
				_data71_->output = FALSE;
				_g_free0 (target_path);
				_g_free0 (source_path);
				break;
			}
			_g_free0 (target_path);
			_g_free0 (source_path);
		}
		_g_free0 (name);
		_g_dir_close0 (dir);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_warning ("filesystem.vala:515: %s", _tmp13_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp14_ = _data71_->callback;
	_tmp14__target = _data71_->callback_target;
	_tmp14__target_destroy_notify = _data71_->callback_target_destroy_notify;
	_data71_->callback = NULL;
	_data71_->callback_target = NULL;
	_data71_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp14_, _tmp14__target, _tmp14__target_destroy_notify);
}

static gpointer
___lambda8__gthread_func (gpointer self)
{
	gpointer result;
	__lambda8_ (self);
	result = NULL;
	block71_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_move_dir_contents_co (ProtonPlusUtilsFilesystemMoveDirContentsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data71_ = g_slice_new0 (Block71Data);
	_data_->_data71_->_ref_count_ = 1;
	_g_free0 (_data_->_data71_->source_dir);
	_data_->_data71_->source_dir = _data_->source_dir;
	_g_free0 (_data_->_data71_->target_dir);
	_data_->_data71_->target_dir = _data_->target_dir;
	_data_->_data71_->_async_data_ = _data_;
	_data_->_data71_->callback = _proton_plus_utils_filesystem_move_dir_contents_co_gsource_func;
	_data_->_data71_->callback_target = _data_;
	_data_->_data71_->callback_target_destroy_notify = NULL;
	_data_->_data71_->output = FALSE;
	_data_->_tmp0_ = g_thread_new ("move_dir_contents", ___lambda8__gthread_func, block71_data_ref (_data_->_data71_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data71_->output;
	block71_data_unref (_data_->_data71_);
	_data_->_data71_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
proton_plus_utils_filesystem_delete_directory_direct (const gchar* path)
{
	GFileEnumerator* enumerator = NULL;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	enumerator = NULL;
	{
		GFile* directory = NULL;
		GFile* _tmp0_;
		GFileEnumerator* _tmp1_ = NULL;
		GFile* _tmp2_;
		GFileEnumerator* _tmp3_;
		GFileEnumerator* _tmp4_;
		GFileInfo* file_info = NULL;
		_tmp0_ = g_file_new_for_path (path);
		directory = _tmp0_;
		_tmp2_ = directory;
		_tmp3_ = g_file_enumerate_children (_tmp2_, "standard::name", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (directory);
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (enumerator);
		enumerator = _tmp4_;
		while (TRUE) {
			GFileInfo* _tmp5_ = NULL;
			GFileEnumerator* _tmp6_;
			GFileInfo* _tmp7_;
			GFileInfo* _tmp8_;
			GFileInfo* _tmp9_;
			gchar* cur_path = NULL;
			GFileInfo* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			struct stat stat_ = {0};
			const gchar* _tmp13_;
			struct stat _tmp14_ = {0};
			gint _tmp15_;
			struct stat _tmp20_;
			_tmp6_ = enumerator;
			_tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error0_);
			_tmp5_ = _tmp7_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (file_info);
				_g_object_unref0 (_tmp1_);
				_g_object_unref0 (directory);
				goto __catch0_g_error;
			}
			_tmp8_ = _tmp5_;
			_tmp5_ = NULL;
			_g_object_unref0 (file_info);
			file_info = _tmp8_;
			_tmp9_ = file_info;
			if (!(_tmp9_ != NULL)) {
				_g_object_unref0 (_tmp5_);
				break;
			}
			_tmp10_ = file_info;
			_tmp11_ = g_file_info_get_name (_tmp10_);
			_tmp12_ = g_build_filename (path, _tmp11_, NULL);
			cur_path = _tmp12_;
			_tmp13_ = cur_path;
			_tmp15_ = lstat (_tmp13_, &_tmp14_);
			stat_ = _tmp14_;
			if (_tmp15_ != 0) {
				result = FALSE;
				_g_free0 (cur_path);
				_g_object_unref0 (_tmp5_);
				_g_object_unref0 (file_info);
				_g_object_unref0 (_tmp1_);
				_g_object_unref0 (directory);
				{
					GError* _inner_error0_ = NULL;
					GFileEnumerator* _tmp16_;
					_tmp16_ = enumerator;
					if (_tmp16_ != NULL) {
						{
							GFileEnumerator* _tmp17_;
							_tmp17_ = enumerator;
							g_file_enumerator_close (_tmp17_, NULL, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								goto __catch1_g_error;
							}
						}
						goto __finally1;
						__catch1_g_error:
						{
							GError* e = NULL;
							GError* _tmp18_;
							const gchar* _tmp19_;
							e = _inner_error0_;
							_inner_error0_ = NULL;
							_tmp18_ = e;
							_tmp19_ = _tmp18_->message;
							g_warning ("filesystem.vala:563: %s", _tmp19_);
							_g_error_free0 (e);
						}
						__finally1:
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
					}
				}
				_g_object_unref0 (enumerator);
				return result;
			}
			_tmp20_ = stat_;
			if (S_ISDIR (_tmp20_.st_mode)) {
				const gchar* _tmp21_;
				const gchar* _tmp26_;
				_tmp21_ = cur_path;
				if (!proton_plus_utils_filesystem_delete_directory_direct (_tmp21_)) {
					result = FALSE;
					_g_free0 (cur_path);
					_g_object_unref0 (_tmp5_);
					_g_object_unref0 (file_info);
					_g_object_unref0 (_tmp1_);
					_g_object_unref0 (directory);
					{
						GError* _inner_error0_ = NULL;
						GFileEnumerator* _tmp22_;
						_tmp22_ = enumerator;
						if (_tmp22_ != NULL) {
							{
								GFileEnumerator* _tmp23_;
								_tmp23_ = enumerator;
								g_file_enumerator_close (_tmp23_, NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									goto __catch2_g_error;
								}
							}
							goto __finally2;
							__catch2_g_error:
							{
								GError* e = NULL;
								GError* _tmp24_;
								const gchar* _tmp25_;
								e = _inner_error0_;
								_inner_error0_ = NULL;
								_tmp24_ = e;
								_tmp25_ = _tmp24_->message;
								g_warning ("filesystem.vala:563: %s", _tmp25_);
								_g_error_free0 (e);
							}
							__finally2:
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								goto __catch0_g_error;
							}
						}
					}
					_g_object_unref0 (enumerator);
					return result;
				}
				_tmp26_ = cur_path;
				if (rmdir (_tmp26_) != 0) {
					result = FALSE;
					_g_free0 (cur_path);
					_g_object_unref0 (_tmp5_);
					_g_object_unref0 (file_info);
					_g_object_unref0 (_tmp1_);
					_g_object_unref0 (directory);
					{
						GError* _inner_error0_ = NULL;
						GFileEnumerator* _tmp27_;
						_tmp27_ = enumerator;
						if (_tmp27_ != NULL) {
							{
								GFileEnumerator* _tmp28_;
								_tmp28_ = enumerator;
								g_file_enumerator_close (_tmp28_, NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									goto __catch3_g_error;
								}
							}
							goto __finally3;
							__catch3_g_error:
							{
								GError* e = NULL;
								GError* _tmp29_;
								const gchar* _tmp30_;
								e = _inner_error0_;
								_inner_error0_ = NULL;
								_tmp29_ = e;
								_tmp30_ = _tmp29_->message;
								g_warning ("filesystem.vala:563: %s", _tmp30_);
								_g_error_free0 (e);
							}
							__finally3:
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								goto __catch0_g_error;
							}
						}
					}
					_g_object_unref0 (enumerator);
					return result;
				}
			} else {
				const gchar* _tmp31_;
				_tmp31_ = cur_path;
				if (!proton_plus_utils_filesystem_delete_file_direct (_tmp31_)) {
					result = FALSE;
					_g_free0 (cur_path);
					_g_object_unref0 (_tmp5_);
					_g_object_unref0 (file_info);
					_g_object_unref0 (_tmp1_);
					_g_object_unref0 (directory);
					{
						GError* _inner_error0_ = NULL;
						GFileEnumerator* _tmp32_;
						_tmp32_ = enumerator;
						if (_tmp32_ != NULL) {
							{
								GFileEnumerator* _tmp33_;
								_tmp33_ = enumerator;
								g_file_enumerator_close (_tmp33_, NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									goto __catch4_g_error;
								}
							}
							goto __finally4;
							__catch4_g_error:
							{
								GError* e = NULL;
								GError* _tmp34_;
								const gchar* _tmp35_;
								e = _inner_error0_;
								_inner_error0_ = NULL;
								_tmp34_ = e;
								_tmp35_ = _tmp34_->message;
								g_warning ("filesystem.vala:563: %s", _tmp35_);
								_g_error_free0 (e);
							}
							__finally4:
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								goto __catch0_g_error;
							}
						}
					}
					_g_object_unref0 (enumerator);
					return result;
				}
			}
			_g_free0 (cur_path);
			_g_object_unref0 (_tmp5_);
		}
		_g_object_unref0 (file_info);
		_g_object_unref0 (_tmp1_);
		_g_object_unref0 (directory);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp36_;
		const gchar* _tmp37_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp36_ = e;
		_tmp37_ = _tmp36_->message;
		g_warning ("filesystem.vala:556: %s", _tmp37_);
		result = FALSE;
		_g_error_free0 (e);
		{
			GError* _inner_error0_ = NULL;
			GFileEnumerator* _tmp38_;
			_tmp38_ = enumerator;
			if (_tmp38_ != NULL) {
				{
					GFileEnumerator* _tmp39_;
					_tmp39_ = enumerator;
					g_file_enumerator_close (_tmp39_, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch5_g_error;
					}
				}
				goto __finally5;
				__catch5_g_error:
				{
					GError* e = NULL;
					GError* _tmp40_;
					const gchar* _tmp41_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp40_ = e;
					_tmp41_ = _tmp40_->message;
					g_warning ("filesystem.vala:563: %s", _tmp41_);
					_g_error_free0 (e);
				}
				__finally5:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (enumerator);
				}
			}
		}
		_g_object_unref0 (enumerator);
		return result;
	}
	__finally0:
	{
		GError* _inner_error1_ = NULL;
		GFileEnumerator* _tmp42_;
		_tmp42_ = enumerator;
		if (_tmp42_ != NULL) {
			{
				GFileEnumerator* _tmp43_;
				_tmp43_ = enumerator;
				g_file_enumerator_close (_tmp43_, NULL, &_inner_error1_);
				if (G_UNLIKELY (_inner_error1_ != NULL)) {
					goto __catch6_g_error;
				}
			}
			goto __finally6;
			__catch6_g_error:
			{
				GError* e = NULL;
				GError* _tmp44_;
				const gchar* _tmp45_;
				e = _inner_error1_;
				_inner_error1_ = NULL;
				_tmp44_ = e;
				_tmp45_ = _tmp44_->message;
				g_warning ("filesystem.vala:563: %s", _tmp45_);
				_g_error_free0 (e);
			}
			__finally6:
			if (G_UNLIKELY (_inner_error1_ != NULL)) {
				gboolean _tmp46_ = FALSE;
				_g_object_unref0 (enumerator);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error1_->message, g_quark_to_string (_inner_error1_->domain), _inner_error1_->code);
				g_clear_error (&_inner_error1_);
				return _tmp46_;
			}
		}
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp47_ = FALSE;
		_g_object_unref0 (enumerator);
		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 _tmp47_;
	}
	result = TRUE;
	_g_object_unref0 (enumerator);
	return result;
}

static void
proton_plus_utils_filesystem_delete_directory_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemDeleteDirectoryData* _data_;
	_data_ = _data;
	g_slice_free (ProtonPlusUtilsFilesystemDeleteDirectoryData, _data_);
}

void
proton_plus_utils_filesystem_delete_directory (const gchar* path,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemDeleteDirectoryData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (path != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemDeleteDirectoryData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_delete_directory_data_free);
	_tmp0_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp0_;
	proton_plus_utils_filesystem_delete_directory_co (_data_);
}

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

static Block72Data*
block72_data_ref (Block72Data* _data72_)
{
	g_atomic_int_inc (&_data72_->_ref_count_);
	return _data72_;
}

static void
block72_data_unref (void * _userdata_)
{
	Block72Data* _data72_;
	_data72_ = (Block72Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data72_->_ref_count_)) {
		(_data72_->callback_target_destroy_notify == NULL) ? NULL : (_data72_->callback_target_destroy_notify (_data72_->callback_target), NULL);
		_data72_->callback = NULL;
		_data72_->callback_target = NULL;
		_data72_->callback_target_destroy_notify = NULL;
		_g_free0 (_data72_->path);
		g_slice_free (Block72Data, _data72_);
	}
}

static gboolean
_proton_plus_utils_filesystem_delete_directory_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_delete_directory_co (self);
	return result;
}

static void
__lambda7_ (Block72Data* _data72_)
{
	struct stat stat_ = {0};
	struct stat _tmp0_ = {0};
	gint _tmp1_;
	GSourceFunc _tmp5_;
	gpointer _tmp5__target;
	GDestroyNotify _tmp5__target_destroy_notify;
	_tmp1_ = lstat (_data72_->path, &_tmp0_);
	stat_ = _tmp0_;
	if (_tmp1_ != 0) {
		_data72_->output = FALSE;
	} else {
		struct stat _tmp2_;
		_tmp2_ = stat_;
		if (S_ISLNK (_tmp2_.st_mode)) {
			_data72_->output = proton_plus_utils_filesystem_delete_file_direct (_data72_->path);
		} else {
			gboolean _tmp3_ = FALSE;
			struct stat _tmp4_;
			_tmp4_ = stat_;
			if (S_ISDIR (_tmp4_.st_mode)) {
				_tmp3_ = proton_plus_utils_filesystem_delete_directory_direct (_data72_->path);
			} else {
				_tmp3_ = FALSE;
			}
			if (_tmp3_) {
				if (rmdir (_data72_->path) == 0) {
					_data72_->output = TRUE;
				}
			}
		}
	}
	_tmp5_ = _data72_->callback;
	_tmp5__target = _data72_->callback_target;
	_tmp5__target_destroy_notify = _data72_->callback_target_destroy_notify;
	_data72_->callback = NULL;
	_data72_->callback_target = NULL;
	_data72_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp5_, _tmp5__target, _tmp5__target_destroy_notify);
}

static gpointer
___lambda7__gthread_func (gpointer self)
{
	gpointer result;
	__lambda7_ (self);
	result = NULL;
	block72_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_delete_directory_co (ProtonPlusUtilsFilesystemDeleteDirectoryData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data72_ = g_slice_new0 (Block72Data);
	_data_->_data72_->_ref_count_ = 1;
	_g_free0 (_data_->_data72_->path);
	_data_->_data72_->path = _data_->path;
	_data_->_data72_->_async_data_ = _data_;
	_data_->_data72_->callback = _proton_plus_utils_filesystem_delete_directory_co_gsource_func;
	_data_->_data72_->callback_target = _data_;
	_data_->_data72_->callback_target_destroy_notify = NULL;
	_data_->_data72_->output = FALSE;
	_data_->_tmp0_ = g_thread_new ("delete_directory", ___lambda7__gthread_func, block72_data_ref (_data_->_data72_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data72_->output;
	block72_data_unref (_data_->_data72_);
	_data_->_data72_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gint
string_index_of_char (const gchar* self,
                      gunichar c,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_strchr (((gchar*) self) + start_index, (gssize) -1, c);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		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;
}

gboolean
proton_plus_utils_filesystem_create_directory (const gchar* path)
{
	gboolean has_leading_slash = FALSE;
	gchar** parts = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint parts_length1;
	gint _parts_size_;
	struct stat stat_ = {0};
	gchar* current_path = NULL;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	has_leading_slash = string_index_of_char (path, (gunichar) '/', 0) == 0;
	_tmp1_ = _tmp0_ = g_strsplit (path, "/", 0);
	parts = _tmp1_;
	parts_length1 = _vala_array_length (_tmp0_);
	_parts_size_ = parts_length1;
	_tmp2_ = g_strdup ("");
	current_path = _tmp2_;
	_tmp3_ = parts;
	_tmp3__length1 = parts_length1;
	{
		gchar** p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = _tmp3_;
		p_collection_length1 = _tmp3__length1;
		for (p_it = 0; p_it < p_collection_length1; p_it = p_it + 1) {
			gchar* _tmp4_;
			gchar* p = NULL;
			_tmp4_ = g_strdup (p_collection[p_it]);
			p = _tmp4_;
			{
				const gchar* _tmp5_;
				gboolean _tmp6_ = FALSE;
				const gchar* _tmp7_;
				const gchar* _tmp16_;
				_tmp5_ = p;
				if (g_strcmp0 (_tmp5_, "") == 0) {
					_g_free0 (p);
					continue;
				}
				_tmp7_ = current_path;
				if (g_strcmp0 (_tmp7_, "") == 0) {
					_tmp6_ = !has_leading_slash;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					const gchar* _tmp8_;
					gchar* _tmp9_;
					_tmp8_ = p;
					_tmp9_ = g_strdup (_tmp8_);
					_g_free0 (current_path);
					current_path = _tmp9_;
				} else {
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					gchar* _tmp13_;
					gchar* _tmp14_;
					gchar* _tmp15_;
					_tmp10_ = current_path;
					_tmp11_ = p;
					_tmp12_ = string_to_string (_tmp11_);
					_tmp13_ = g_strconcat ("/", _tmp12_, NULL);
					_tmp14_ = _tmp13_;
					_tmp15_ = g_strconcat (_tmp10_, _tmp14_, NULL);
					_g_free0 (current_path);
					current_path = _tmp15_;
					_g_free0 (_tmp14_);
				}
				_tmp16_ = current_path;
				if (mkdir (_tmp16_, PROTON_PLUS_UTILS_FILESYSTEM_S_IRWXUGO) != 0) {
					gint error_number = 0;
					const gchar* _tmp19_;
					struct stat _tmp20_ = {0};
					gint _tmp21_;
					struct stat _tmp24_;
					error_number = errno;
					if (error_number != EEXIST) {
						const gchar* _tmp17_;
						const gchar* _tmp18_;
						_tmp17_ = current_path;
						_tmp18_ = strerror (error_number);
						g_warning ("filesystem.vala:630: Could not create directory '%s': %s", _tmp17_, _tmp18_);
						result = FALSE;
						_g_free0 (p);
						_g_free0 (current_path);
						parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
						return result;
					}
					_tmp19_ = current_path;
					_tmp21_ = stat (_tmp19_, &_tmp20_);
					stat_ = _tmp20_;
					if (_tmp21_ != 0) {
						const gchar* _tmp22_;
						const gchar* _tmp23_;
						error_number = errno;
						_tmp22_ = current_path;
						_tmp23_ = strerror (error_number);
						g_warning ("filesystem.vala:642: Could not inspect directory '%s': %s", _tmp22_, _tmp23_);
						result = FALSE;
						_g_free0 (p);
						_g_free0 (current_path);
						parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
						return result;
					}
					_tmp24_ = stat_;
					if (!S_ISDIR (_tmp24_.st_mode)) {
						const gchar* _tmp25_;
						_tmp25_ = current_path;
						g_warning ("filesystem.vala:650: Directory path component is not a directory: %s", _tmp25_);
						result = FALSE;
						_g_free0 (p);
						_g_free0 (current_path);
						parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
						return result;
					}
				}
				_g_free0 (p);
			}
		}
	}
	result = TRUE;
	_g_free0 (current_path);
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static void
proton_plus_utils_filesystem_create_directory_async_data_free (gpointer _data)
{
	ProtonPlusUtilsFilesystemCreateDirectoryAsyncData* _data_;
	_data_ = _data;
	g_slice_free (ProtonPlusUtilsFilesystemCreateDirectoryAsyncData, _data_);
}

void
proton_plus_utils_filesystem_create_directory_async (const gchar* path,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	ProtonPlusUtilsFilesystemCreateDirectoryAsyncData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (path != NULL);
	_data_ = g_slice_new0 (ProtonPlusUtilsFilesystemCreateDirectoryAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_utils_filesystem_create_directory_async_data_free);
	_tmp0_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp0_;
	proton_plus_utils_filesystem_create_directory_async_co (_data_);
}

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

static Block73Data*
block73_data_ref (Block73Data* _data73_)
{
	g_atomic_int_inc (&_data73_->_ref_count_);
	return _data73_;
}

static void
block73_data_unref (void * _userdata_)
{
	Block73Data* _data73_;
	_data73_ = (Block73Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data73_->_ref_count_)) {
		(_data73_->callback_target_destroy_notify == NULL) ? NULL : (_data73_->callback_target_destroy_notify (_data73_->callback_target), NULL);
		_data73_->callback = NULL;
		_data73_->callback_target = NULL;
		_data73_->callback_target_destroy_notify = NULL;
		_g_free0 (_data73_->path);
		g_slice_free (Block73Data, _data73_);
	}
}

static gboolean
_proton_plus_utils_filesystem_create_directory_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_utils_filesystem_create_directory_async_co (self);
	return result;
}

static void
__lambda9_ (Block73Data* _data73_)
{
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	_data73_->output = proton_plus_utils_filesystem_create_directory (_data73_->path);
	_tmp0_ = _data73_->callback;
	_tmp0__target = _data73_->callback_target;
	_tmp0__target_destroy_notify = _data73_->callback_target_destroy_notify;
	_data73_->callback = NULL;
	_data73_->callback_target = NULL;
	_data73_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify);
}

static gpointer
___lambda9__gthread_func (gpointer self)
{
	gpointer result;
	__lambda9_ (self);
	result = NULL;
	block73_data_unref (self);
	return result;
}

static gboolean
proton_plus_utils_filesystem_create_directory_async_co (ProtonPlusUtilsFilesystemCreateDirectoryAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data73_ = g_slice_new0 (Block73Data);
	_data_->_data73_->_ref_count_ = 1;
	_g_free0 (_data_->_data73_->path);
	_data_->_data73_->path = _data_->path;
	_data_->_data73_->_async_data_ = _data_;
	_data_->_data73_->callback = _proton_plus_utils_filesystem_create_directory_async_co_gsource_func;
	_data_->_data73_->callback_target = _data_;
	_data_->_data73_->callback_target_destroy_notify = NULL;
	_data_->_data73_->output = FALSE;
	_data_->_tmp0_ = g_thread_new ("create_directory", ___lambda9__gthread_func, block73_data_ref (_data_->_data73_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data73_->output;
	block73_data_unref (_data_->_data73_);
	_data_->_data73_ = 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;
}

guint64
proton_plus_utils_filesystem_get_directory_size (const gchar* path)
{
	guint64 size = 0ULL;
	GFileEnumerator* enumerator = NULL;
	GError* _inner_error0_ = NULL;
	guint64 result;
	g_return_val_if_fail (path != NULL, 0ULL);
	size = (guint64) 0;
	enumerator = NULL;
	{
		GFile* directory = NULL;
		GFile* _tmp0_;
		GFileEnumerator* _tmp1_ = NULL;
		GFile* _tmp2_;
		GFileEnumerator* _tmp3_;
		GFileEnumerator* _tmp4_;
		GFileInfo* file_info = NULL;
		_tmp0_ = g_file_new_for_path (path);
		directory = _tmp0_;
		_tmp2_ = directory;
		_tmp3_ = g_file_enumerate_children (_tmp2_, "standard::name", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (directory);
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (enumerator);
		enumerator = _tmp4_;
		while (TRUE) {
			GFileInfo* _tmp5_ = NULL;
			GFileEnumerator* _tmp6_;
			GFileInfo* _tmp7_;
			GFileInfo* _tmp8_;
			GFileInfo* _tmp9_;
			gchar* cur_path = NULL;
			GFileInfo* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			struct stat stat_ = {0};
			const gchar* _tmp13_;
			struct stat _tmp14_ = {0};
			gint _tmp15_;
			struct stat _tmp16_;
			_tmp6_ = enumerator;
			_tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error0_);
			_tmp5_ = _tmp7_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (file_info);
				_g_object_unref0 (_tmp1_);
				_g_object_unref0 (directory);
				goto __catch0_g_error;
			}
			_tmp8_ = _tmp5_;
			_tmp5_ = NULL;
			_g_object_unref0 (file_info);
			file_info = _tmp8_;
			_tmp9_ = file_info;
			if (!(_tmp9_ != NULL)) {
				_g_object_unref0 (_tmp5_);
				break;
			}
			_tmp10_ = file_info;
			_tmp11_ = g_file_info_get_name (_tmp10_);
			_tmp12_ = g_build_filename (path, _tmp11_, NULL);
			cur_path = _tmp12_;
			_tmp13_ = cur_path;
			_tmp15_ = lstat (_tmp13_, &_tmp14_);
			stat_ = _tmp14_;
			if (_tmp15_ != 0) {
				_g_free0 (cur_path);
				_g_object_unref0 (_tmp5_);
				continue;
			}
			_tmp16_ = stat_;
			if (S_ISDIR (_tmp16_.st_mode)) {
				const gchar* _tmp17_;
				_tmp17_ = cur_path;
				size += proton_plus_utils_filesystem_get_directory_size (_tmp17_);
			} else {
				struct stat _tmp18_;
				_tmp18_ = stat_;
				size += (guint64) _tmp18_.st_size;
			}
			_g_free0 (cur_path);
			_g_object_unref0 (_tmp5_);
		}
		_g_object_unref0 (file_info);
		_g_object_unref0 (_tmp1_);
		_g_object_unref0 (directory);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = e;
		_tmp20_ = _tmp19_->message;
		g_warning ("filesystem.vala:702: %s", _tmp20_);
		_g_error_free0 (e);
	}
	__finally0:
	{
		GError* _inner_error1_ = NULL;
		GFileEnumerator* _tmp21_;
		_tmp21_ = enumerator;
		if (_tmp21_ != NULL) {
			{
				GFileEnumerator* _tmp22_;
				_tmp22_ = enumerator;
				g_file_enumerator_close (_tmp22_, NULL, &_inner_error1_);
				if (G_UNLIKELY (_inner_error1_ != NULL)) {
					goto __catch1_g_error;
				}
			}
			goto __finally1;
			__catch1_g_error:
			{
				GError* e = NULL;
				GError* _tmp23_;
				const gchar* _tmp24_;
				e = _inner_error1_;
				_inner_error1_ = NULL;
				_tmp23_ = e;
				_tmp24_ = _tmp23_->message;
				g_warning ("filesystem.vala:708: %s", _tmp24_);
				_g_error_free0 (e);
			}
			__finally1:
			if (G_UNLIKELY (_inner_error1_ != NULL)) {
				guint64 _tmp25_ = 0ULL;
				_g_object_unref0 (enumerator);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error1_->message, g_quark_to_string (_inner_error1_->domain), _inner_error1_->code);
				g_clear_error (&_inner_error1_);
				return _tmp25_;
			}
		}
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		guint64 _tmp26_ = 0ULL;
		_g_object_unref0 (enumerator);
		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 _tmp26_;
	}
	result = size;
	_g_object_unref0 (enumerator);
	return result;
}

ProtonPlusUtilsFilesystem*
proton_plus_utils_filesystem_construct (GType object_type)
{
	ProtonPlusUtilsFilesystem* self = NULL;
	self = (ProtonPlusUtilsFilesystem*) g_type_create_instance (object_type);
	return self;
}

ProtonPlusUtilsFilesystem*
proton_plus_utils_filesystem_new (void)
{
	return proton_plus_utils_filesystem_construct (PROTON_PLUS_UTILS_TYPE_FILESYSTEM);
}

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

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

static void
proton_plus_utils_value_filesystem_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_filesystem_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

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

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

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

void
proton_plus_utils_value_set_filesystem (GValue* value,
                                        gpointer v_object)
{
	ProtonPlusUtilsFilesystem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_UTILS_TYPE_FILESYSTEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_UTILS_TYPE_FILESYSTEM));
		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_filesystem_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_utils_filesystem_unref (old);
	}
}

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

static void
proton_plus_utils_filesystem_class_init (ProtonPlusUtilsFilesystemClass * klass,
                                         gpointer klass_data)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar** _tmp24_;
	proton_plus_utils_filesystem_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusUtilsFilesystemClass *) klass)->finalize = proton_plus_utils_filesystem_finalize;
	_tmp0_ = g_strdup ("width");
	_tmp1_ = g_strdup ("height");
	_tmp2_ = g_strdup ("is-maximized");
	_tmp3_ = g_strdup ("is-fullscreen");
	_tmp4_ = g_strdup ("check-updates-on-launch");
	_tmp5_ = g_strdup ("background-updates");
	_tmp6_ = g_strdup ("background-updates-frequency");
	_tmp7_ = g_strdup ("check-updates-on-boot");
	_tmp8_ = g_strdup ("github-api-key");
	_tmp9_ = g_strdup ("gitlab-api-key");
	_tmp10_ = g_strdup ("selected-tool-variants");
	_tmp11_ = g_strdup ("steam-selected-profile-id");
	_tmp12_ = g_strdup ("first-run");
	_tmp13_ = g_strdup ("theme");
	_tmp14_ = g_strdup ("language");
	_tmp15_ = g_strdup ("experimental-features");
	_tmp16_ = g_strdup ("show-legacy-tools");
	_tmp17_ = g_strdup ("migrate-default-prefix");
	_tmp18_ = g_strdup ("proxy-mode");
	_tmp19_ = g_strdup ("proxy-url");
	_tmp20_ = g_strdup ("download-speed-limit-bps");
	_tmp21_ = g_strdup ("controller-confirm-button");
	_tmp22_ = g_strdup ("controller-haptics-enabled");
	_tmp23_ = g_strdup ("last-version");
	_tmp24_ = g_new0 (gchar*, 24 + 1);
	_tmp24_[0] = _tmp0_;
	_tmp24_[1] = _tmp1_;
	_tmp24_[2] = _tmp2_;
	_tmp24_[3] = _tmp3_;
	_tmp24_[4] = _tmp4_;
	_tmp24_[5] = _tmp5_;
	_tmp24_[6] = _tmp6_;
	_tmp24_[7] = _tmp7_;
	_tmp24_[8] = _tmp8_;
	_tmp24_[9] = _tmp9_;
	_tmp24_[10] = _tmp10_;
	_tmp24_[11] = _tmp11_;
	_tmp24_[12] = _tmp12_;
	_tmp24_[13] = _tmp13_;
	_tmp24_[14] = _tmp14_;
	_tmp24_[15] = _tmp15_;
	_tmp24_[16] = _tmp16_;
	_tmp24_[17] = _tmp17_;
	_tmp24_[18] = _tmp18_;
	_tmp24_[19] = _tmp19_;
	_tmp24_[20] = _tmp20_;
	_tmp24_[21] = _tmp21_;
	_tmp24_[22] = _tmp22_;
	_tmp24_[23] = _tmp23_;
	proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS = _tmp24_;
	proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_length1 = 24;
	_proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_size_ = proton_plus_utils_filesystem_REQUIRED_SCHEMA_KEYS_length1;
}

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

static void
proton_plus_utils_filesystem_finalize (ProtonPlusUtilsFilesystem * obj)
{
	ProtonPlusUtilsFilesystem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_FILESYSTEM, ProtonPlusUtilsFilesystem);
	g_signal_handlers_destroy (self);
}

static GType
proton_plus_utils_filesystem_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { proton_plus_utils_value_filesystem_init, proton_plus_utils_value_filesystem_free_value, proton_plus_utils_value_filesystem_copy_value, proton_plus_utils_value_filesystem_peek_pointer, "p", proton_plus_utils_value_filesystem_collect_value, "p", proton_plus_utils_value_filesystem_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsFilesystemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_filesystem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsFilesystem), 0, (GInstanceInitFunc) proton_plus_utils_filesystem_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_filesystem_type_id;
	proton_plus_utils_filesystem_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ProtonPlusUtilsFilesystem", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return proton_plus_utils_filesystem_type_id;
}

GType
proton_plus_utils_filesystem_get_type (void)
{
	static volatile gsize proton_plus_utils_filesystem_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_filesystem_type_id__once)) {
		GType proton_plus_utils_filesystem_type_id;
		proton_plus_utils_filesystem_type_id = proton_plus_utils_filesystem_get_type_once ();
		g_once_init_leave (&proton_plus_utils_filesystem_type_id__once, proton_plus_utils_filesystem_type_id);
	}
	return proton_plus_utils_filesystem_type_id__once;
}

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

void
proton_plus_utils_filesystem_unref (gpointer instance)
{
	ProtonPlusUtilsFilesystem * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PROTON_PLUS_UTILS_FILESYSTEM_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;
}

