/* os-database.c generated by valac 0.25.2.7-aa52, the Vala compiler
 * generated from os-database.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <osinfo/osinfo.h>
#include <gio/gio.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>


#define BOXES_TYPE_OS_DATABASE (boxes_os_database_get_type ())
#define BOXES_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabase))
#define BOXES_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))
#define BOXES_IS_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OS_DATABASE))
#define BOXES_IS_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OS_DATABASE))
#define BOXES_OS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))

typedef struct _BoxesOSDatabase BoxesOSDatabase;
typedef struct _BoxesOSDatabaseClass BoxesOSDatabaseClass;
typedef struct _BoxesOSDatabasePrivate BoxesOSDatabasePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block56Data Block56Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesOsDatabaseLoadData BoxesOsDatabaseLoadData;
typedef struct _BoxesOsDatabaseGuessOsFromInstallMediaPathData BoxesOsDatabaseGuessOsFromInstallMediaPathData;
typedef struct _BoxesOsDatabaseGuessOsFromInstallMediaData BoxesOsDatabaseGuessOsFromInstallMediaData;
typedef struct _BoxesOsDatabaseGetOsByIdData BoxesOsDatabaseGetOsByIdData;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _BoxesOsDatabaseListOsByDistroData BoxesOsDatabaseListOsByDistroData;

#define BOXES_TYPE_CPU_ARCH_COMPATIBILITY (boxes_cpu_arch_compatibility_get_type ())
typedef struct _Block57Data Block57Data;
typedef struct _Block58Data Block58Data;
typedef struct _BoxesOsDatabaseEnsureDbLoadedData BoxesOsDatabaseEnsureDbLoadedData;

typedef enum  {
	BOXES_OS_DATABASE_ERROR_NON_BOOTABLE,
	BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID
} BoxesOSDatabaseError;
#define BOXES_OS_DATABASE_ERROR boxes_os_database_error_quark ()
struct _BoxesOSDatabase {
	GObject parent_instance;
	BoxesOSDatabasePrivate * priv;
};

struct _BoxesOSDatabaseClass {
	GObjectClass parent_class;
};

struct _BoxesOSDatabasePrivate {
	OsinfoDb* db;
	gboolean db_loading;
};

struct _Block56Data {
	int _ref_count_;
	BoxesOSDatabase* self;
	OsinfoLoader* loader;
	gpointer _async_data_;
};

struct _BoxesOsDatabaseLoadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	Block56Data* _data56_;
	OsinfoLoader* _tmp0_;
	GError* e;
	GError* _tmp1_;
	const gchar* _tmp2_;
	GError* _vala1_e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	OsinfoDb* _tmp5_;
	OsinfoDb* _tmp6_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGuessOsFromInstallMediaPathData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gchar* media_path;
	GCancellable* cancellable;
	OsinfoMedia* result;
	gboolean _tmp0_;
	OsinfoMedia* media;
	const gchar* _tmp1_;
	GCancellable* _tmp2_;
	OsinfoMedia* _tmp3_;
	OsinfoMedia* _tmp4_;
	OsinfoMedia* _tmp5_;
	OsinfoMedia* _tmp6_;
	OsinfoMedia* _tmp7_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGuessOsFromInstallMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	OsinfoMedia* media;
	OsinfoMedia* result;
	gboolean _tmp0_;
	OsinfoDb* _tmp1_;
	OsinfoMedia* _tmp2_;
	gboolean _tmp3_;
	OsinfoMedia* _tmp4_;
	OsinfoMedia* _tmp5_;
};

struct _BoxesOsDatabaseGetOsByIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gchar* id;
	OsinfoOs* result;
	gboolean _tmp0_;
	GError* _tmp1_;
	OsinfoOs* os;
	OsinfoDb* _tmp2_;
	const gchar* _tmp3_;
	OsinfoOs* _tmp4_;
	OsinfoOs* _tmp5_;
	OsinfoOs* _tmp6_;
	const gchar* _tmp7_;
	GError* _tmp8_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseListOsByDistroData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gchar* distro;
	GDate* after;
	GList* result;
	gboolean _tmp0_;
	GError* _tmp1_;
	OsinfoOsList* os_list;
	OsinfoDb* _tmp2_;
	OsinfoOsList* _tmp3_;
	OsinfoFilter* filter;
	OsinfoFilter* _tmp4_;
	OsinfoFilter* _tmp5_;
	const gchar* _tmp6_;
	OsinfoOsList* _tmp7_;
	OsinfoFilter* _tmp8_;
	OsinfoList* _tmp9_;
	OsinfoOsList* _tmp10_;
	GList* after_list;
	OsinfoOsList* _tmp11_;
	GList* _tmp12_;
	GList* entity_collection;
	GList* entity_it;
	OsinfoEntity* entity;
	OsinfoOs* os;
	OsinfoEntity* _tmp13_;
	OsinfoOs* _tmp14_;
	GDate* _tmp15_;
	GDate* release_date;
	OsinfoOs* _tmp16_;
	GDate* _tmp17_;
	OsinfoReleaseStatus status;
	OsinfoOs* _tmp18_;
	OsinfoReleaseStatus _tmp19_;
	gboolean _tmp20_;
	OsinfoReleaseStatus _tmp21_;
	gboolean _tmp22_;
	GDate* _tmp23_;
	GDate* _tmp24_;
	GDate* _tmp25_;
	GDate _tmp26_;
	gint _tmp27_;
	OsinfoOs* _tmp28_;
	OsinfoOs* _tmp29_;
	OsinfoOs* _tmp30_;
	OsinfoOs* _tmp31_;
	GError * _inner_error_;
};

typedef enum  {
	BOXES_CPU_ARCH_COMPATIBILITY_INCOMPATIBLE = -1,
	BOXES_CPU_ARCH_COMPATIBILITY_IDENTICAL = 0,
	BOXES_CPU_ARCH_COMPATIBILITY_COMPATIBLE = 1,
	BOXES_CPU_ARCH_COMPATIBILITY_COMPATIBLE_DIFF_WORDSIZE = 2
} BoxesCPUArchCompatibility;

struct _Block57Data {
	int _ref_count_;
	BoxesOSDatabase* self;
	gpointer _async_data_;
};

struct _Block58Data {
	int _ref_count_;
	Block57Data * _data57_;
	gulong db_loaded_id;
};

struct _BoxesOsDatabaseEnsureDbLoadedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gboolean result;
	Block57Data* _data57_;
	OsinfoDb* _tmp0_;
	gboolean _tmp1_;
	Block58Data* _data58_;
	gulong _tmp2_;
	OsinfoDb* _tmp3_;
};


static gpointer boxes_os_database_parent_class = NULL;

GQuark boxes_os_database_error_quark (void);
GType boxes_os_database_get_type (void) G_GNUC_CONST;
#define BOXES_OS_DATABASE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_OS_DATABASE, BoxesOSDatabasePrivate))
enum  {
	BOXES_OS_DATABASE_DUMMY_PROPERTY
};
#define BOXES_OS_DATABASE_DEFAULT_VCPUS 1
#define BOXES_OS_DATABASE_DEFAULT_RAM (1 * ((gint64) OSINFO_GIBIBYTES))
#define BOXES_OS_DATABASE_DEFAULT_STORAGE (20 * ((gint64) OSINFO_GIBIBYTES))
OsinfoResources* boxes_os_database_get_default_resources (void);
static void boxes_os_database_load_data_free (gpointer _data);
void boxes_os_database_load (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_os_database_load_finish (BoxesOSDatabase* self, GAsyncResult* _res_);
static gboolean boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_);
static Block56Data* block56_data_ref (Block56Data* _data56_);
static void block56_data_unref (void * _userdata_);
static void ___lambda19_ (Block56Data* _data56_, GError** error);
static void ____lambda19__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_os_database_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void ___lambda20_ (Block56Data* _data56_, GError** error);
static void ____lambda20__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_os_database_guess_os_from_install_media_path_data_free (gpointer _data);
void boxes_os_database_guess_os_from_install_media_path (BoxesOSDatabase* self, const gchar* media_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
OsinfoMedia* boxes_os_database_guess_os_from_install_media_path_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_os_database_guess_os_from_install_media_path_co (BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_);
static void boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self, GAsyncResult* _res_);
static void boxes_os_database_guess_os_from_install_media_path_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_os_database_guess_os_from_install_media (BoxesOSDatabase* self, OsinfoMedia* media, GAsyncReadyCallback _callback_, gpointer _user_data_);
OsinfoMedia* boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static void boxes_os_database_guess_os_from_install_media_data_free (gpointer _data);
static gboolean boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_);
static void boxes_os_database_guess_os_from_install_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_os_database_get_os_by_id_data_free (gpointer _data);
void boxes_os_database_get_os_by_id (BoxesOSDatabase* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_);
OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_);
static void boxes_os_database_get_os_by_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
static void boxes_os_database_list_os_by_distro_data_free (gpointer _data);
static GDate* _g_date_dup (GDate* self);
void boxes_os_database_list_os_by_distro (BoxesOSDatabase* self, const gchar* distro, GDate* after, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* boxes_os_database_list_os_by_distro_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_os_database_list_os_by_distro_co (BoxesOsDatabaseListOsByDistroData* _data_);
static void boxes_os_database_list_os_by_distro_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gint __lambda22_ (OsinfoOs* os_a, OsinfoOs* os_b);
static gint ___lambda22__gcompare_func (gconstpointer a, gconstpointer b);
OsinfoMedia* boxes_os_database_get_media_by_id (BoxesOSDatabase* self, OsinfoOs* os, const gchar* id, GError** error);
OsinfoResources* boxes_os_database_get_resources_for_os (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture);
static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value);
static gchar** _vala_array_dup3 (gchar** self, int length);
static OsinfoResources* boxes_os_database_get_prefered_resources (OsinfoResourcesList* list, gchar** prefs, int prefs_length1);
static OsinfoResources* boxes_os_database_get_resources_from_os_resources (BoxesOSDatabase* self, OsinfoResources* minimum, OsinfoResources* recommended);
OsinfoResources* boxes_os_database_get_recommended_resources_for_os (OsinfoOs* os, const gchar* architecture);
OsinfoResources* boxes_os_database_get_minimum_resources_for_os (OsinfoOs* os, const gchar* architecture);
static OsinfoResourcesList* boxes_os_database_filter_resources_list_by_arch (OsinfoResourcesList* list, const gchar* arch);
GType boxes_cpu_arch_compatibility_get_type (void) G_GNUC_CONST;
BoxesCPUArchCompatibility boxes_compare_cpu_architectures (const gchar* arch1, const gchar* arch2);
static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data);
static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_);
static Block57Data* block57_data_ref (Block57Data* _data57_);
static void block57_data_unref (void * _userdata_);
static Block58Data* block58_data_ref (Block58Data* _data58_);
static void block58_data_unref (void * _userdata_);
static void ___lambda21_ (Block58Data* _data58_);
static void ____lambda21__boxes_os_database_db_loaded (BoxesOSDatabase* _sender, gpointer self);
BoxesOSDatabase* boxes_os_database_new (void);
BoxesOSDatabase* boxes_os_database_construct (GType object_type);
static void boxes_os_database_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GQuark boxes_os_database_error_quark (void) {
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
	return g_quark_from_static_string ("boxes_os_database_error-quark");
#line 316 "os-database.c"
}


OsinfoResources* boxes_os_database_get_default_resources (void) {
	OsinfoResources* result = NULL;
	OsinfoResources* resources = NULL;
	OsinfoResources* _tmp0_ = NULL;
#line 27 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resources_new ("whatever", "x86_64");
#line 27 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 29 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_n_cpus (resources, BOXES_OS_DATABASE_DEFAULT_VCPUS);
#line 30 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_ram (resources, BOXES_OS_DATABASE_DEFAULT_RAM);
#line 31 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_storage (resources, BOXES_OS_DATABASE_DEFAULT_STORAGE);
#line 33 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = resources;
#line 33 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 338 "os-database.c"
}


static void boxes_os_database_load_data_free (gpointer _data) {
	BoxesOsDatabaseLoadData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseLoadData, _data_);
#line 349 "os-database.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return self ? g_object_ref (self) : NULL;
#line 356 "os-database.c"
}


void boxes_os_database_load (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseLoadData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_load);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_load_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 375 "os-database.c"
}


void boxes_os_database_load_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	BoxesOsDatabaseLoadData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 383 "os-database.c"
}


static Block56Data* block56_data_ref (Block56Data* _data56_) {
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data56_->_ref_count_);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return _data56_;
#line 392 "os-database.c"
}


static void block56_data_unref (void * _userdata_) {
	Block56Data* _data56_;
	_data56_ = (Block56Data*) _userdata_;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data56_->_ref_count_)) {
#line 401 "os-database.c"
		BoxesOSDatabase* self;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		self = _data56_->self;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data56_->loader);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_slice_free (Block56Data, _data56_);
#line 411 "os-database.c"
	}
}


static void ___lambda19_ (Block56Data* _data56_, GError** error) {
	BoxesOSDatabase* self;
	GError * _inner_error_ = NULL;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self = _data56_->self;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_default_path (_data56_->loader, &_inner_error_);
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return;
#line 429 "os-database.c"
	}
}


static void ____lambda19__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	___lambda19_ (self, error);
#line 437 "os-database.c"
}


static void boxes_os_database_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 451 "os-database.c"
}


static void ___lambda20_ (Block56Data* _data56_, GError** error) {
	BoxesOSDatabase* self;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self = _data56_->self;
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_get_logos_db ();
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = _tmp0_;
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_path (_data56_->loader, _tmp1_, &_inner_error_);
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_tmp1_);
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return;
#line 476 "os-database.c"
	}
}


static void ____lambda20__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	___lambda20_ (self, error);
#line 484 "os-database.c"
}


static gboolean boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_) {
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 493 "os-database.c"
		goto _state_0;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 497 "os-database.c"
		goto _state_1;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 2:
#line 501 "os-database.c"
		goto _state_2;
		default:
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 506 "os-database.c"
	}
	_state_0:
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_ = g_slice_new0 (Block56Data);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_->_ref_count_ = 1;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_->self = g_object_ref (_data_->self);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_->_async_data_ = _data_;
#line 37 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = TRUE;
#line 38 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = NULL;
#line 38 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = osinfo_loader_new ();
#line 38 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_->loader = _data_->_tmp0_;
#line 525 "os-database.c"
	{
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda19__boxes_run_in_thread_func, block56_data_ref (_data_->_data56_), block56_data_unref, boxes_os_database_load_ready, _data_);
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 533 "os-database.c"
		_state_1:
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 40 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 539 "os-database.c"
			goto __catch66_g_error;
		}
	}
	goto __finally66;
	__catch66_g_error:
	{
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->e = _data_->_inner_error_;
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 42 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = NULL;
#line 42 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _data_->e;
#line 42 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = NULL;
#line 42 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = _data_->_tmp1_->message;
#line 42 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:42: Error loading default libosinfo database: %s", _data_->_tmp2_);
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->e);
#line 562 "os-database.c"
	}
	__finally66:
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		block56_data_unref (_data_->_data56_);
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data56_ = NULL;
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 39 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 577 "os-database.c"
	}
	{
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 2;
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda20__boxes_run_in_thread_func, block56_data_ref (_data_->_data56_), block56_data_unref, boxes_os_database_load_ready, _data_);
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 586 "os-database.c"
		_state_2:
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 45 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 592 "os-database.c"
			goto __catch67_g_error;
		}
	}
	goto __finally67;
	__catch67_g_error:
	{
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_vala1_e = _data_->_inner_error_;
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 47 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = NULL;
#line 47 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = _data_->_vala1_e;
#line 47 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = NULL;
#line 47 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 47 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:47: Error loading GNOME Boxes libosinfo database: %s", _data_->_tmp4_);
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->_vala1_e);
#line 615 "os-database.c"
	}
	__finally67:
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		block56_data_unref (_data_->_data56_);
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data56_ = NULL;
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 44 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 630 "os-database.c"
	}
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_loader_get_db (_data_->_data56_->loader);
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self->priv->db);
#line 49 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db = _data_->_tmp6_;
#line 50 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = FALSE;
#line 51 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_signal_emit_by_name (_data_->self, "db-loaded");
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	block56_data_unref (_data_->_data56_);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data56_ = NULL;
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 656 "os-database.c"
	} else {
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 660 "os-database.c"
	}
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 36 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 666 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_path_data_free (gpointer _data) {
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGuessOsFromInstallMediaPathData, _data_);
#line 683 "os-database.c"
}


void boxes_os_database_guess_os_from_install_media_path (BoxesOSDatabase* self, const gchar* media_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GCancellable* _tmp3_ = NULL;
	GCancellable* _tmp4_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaPathData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_guess_os_from_install_media_path);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_guess_os_from_install_media_path_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = media_path;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->media_path = _tmp2_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = cancellable;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->cancellable = _tmp4_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_path_co (_data_);
#line 722 "os-database.c"
}


OsinfoMedia* boxes_os_database_guess_os_from_install_media_path_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoMedia* result;
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return NULL;
#line 733 "os-database.c"
	}
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 743 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_path_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_path_co (_data_);
#line 757 "os-database.c"
}


static gboolean boxes_os_database_guess_os_from_install_media_path_co (BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_) {
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 766 "os-database.c"
		goto _state_0;
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 770 "os-database.c"
		goto _state_1;
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 2:
#line 774 "os-database.c"
		goto _state_2;
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 3:
#line 778 "os-database.c"
		goto _state_3;
		default:
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 783 "os-database.c"
	}
	_state_0:
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 792 "os-database.c"
	_state_1:
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 56 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 806 "os-database.c"
		} else {
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 810 "os-database.c"
		}
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 57 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 816 "os-database.c"
	}
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = NULL;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->media_path;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->cancellable;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 2;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_media_create_from_location_async (_data_->_tmp1_, G_PRIORITY_DEFAULT, _data_->_tmp2_, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 832 "os-database.c"
	_state_2:
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_media_create_from_location_finish (_data_->_res_, &_data_->_inner_error_);
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->media = _data_->_tmp3_;
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_error_free (_data_->_inner_error_);
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 850 "os-database.c"
		} else {
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 854 "os-database.c"
		}
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 59 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 860 "os-database.c"
	}
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _data_->media;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 3;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media (_data_->self, _data_->_tmp5_, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 872 "os-database.c"
	_state_3:
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = boxes_os_database_guess_os_from_install_media_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->_tmp6_;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_error_free (_data_->_inner_error_);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->media);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 892 "os-database.c"
		} else {
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 896 "os-database.c"
		}
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 902 "os-database.c"
	}
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = NULL;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = _data_->_tmp4_;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = NULL;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp7_;
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->_tmp4_);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 920 "os-database.c"
	} else {
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 924 "os-database.c"
	}
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 61 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->_tmp4_);
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 938 "os-database.c"
	} else {
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 942 "os-database.c"
	}
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 54 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 948 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_data_free (gpointer _data) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGuessOsFromInstallMediaData, _data_);
#line 963 "os-database.c"
}


void boxes_os_database_guess_os_from_install_media (BoxesOSDatabase* self, OsinfoMedia* media, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
	OsinfoMedia* _tmp1_ = NULL;
	OsinfoMedia* _tmp2_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_guess_os_from_install_media);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_guess_os_from_install_media_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = media;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->media = _tmp2_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 992 "os-database.c"
}


OsinfoMedia* boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoMedia* result;
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1003 "os-database.c"
	}
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 1013 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 1027 "os-database.c"
}


static gboolean boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_) {
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 1036 "os-database.c"
		goto _state_0;
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 1040 "os-database.c"
		goto _state_1;
		default:
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1045 "os-database.c"
	}
	_state_0:
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_guess_os_from_install_media_ready, _data_);
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1054 "os-database.c"
	_state_1:
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 65 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1068 "os-database.c"
		} else {
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1072 "os-database.c"
		}
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 66 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1078 "os-database.c"
	}
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = NULL;
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db;
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->media;
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = FALSE;
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_db_identify_media (_data_->_tmp1_, _data_->_tmp2_);
#line 68 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp3_) {
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = NULL;
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->media;
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = NULL;
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->result = _data_->_tmp5_;
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1108 "os-database.c"
		} else {
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1112 "os-database.c"
		}
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 69 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1118 "os-database.c"
	}
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1126 "os-database.c"
	} else {
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1130 "os-database.c"
	}
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 71 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1140 "os-database.c"
	} else {
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1144 "os-database.c"
	}
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 64 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1150 "os-database.c"
}


static void boxes_os_database_get_os_by_id_data_free (gpointer _data) {
	BoxesOsDatabaseGetOsByIdData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGetOsByIdData, _data_);
#line 1165 "os-database.c"
}


void boxes_os_database_get_os_by_id (BoxesOSDatabase* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseGetOsByIdData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGetOsByIdData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_get_os_by_id);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_get_os_by_id_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = id;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->id = _tmp2_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 1194 "os-database.c"
}


OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoOs* result;
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1205 "os-database.c"
	}
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 1215 "os-database.c"
}


static void boxes_os_database_get_os_by_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 1229 "os-database.c"
}


static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_) {
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 1238 "os-database.c"
		goto _state_0;
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 1242 "os-database.c"
		goto _state_1;
		default:
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1247 "os-database.c"
	}
	_state_0:
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_get_os_by_id_ready, _data_);
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1256 "os-database.c"
	_state_1:
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 75 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = NULL;
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = g_error_new_literal (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED, "Failed to load OS database");
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp1_;
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1280 "os-database.c"
			} else {
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1284 "os-database.c"
			}
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1290 "os-database.c"
		} else {
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 76 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1298 "os-database.c"
		}
	}
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->self->priv->db;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->id;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = NULL;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = osinfo_db_get_os (_data_->_tmp2_, _data_->_tmp3_);
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
#line 78 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->os = _data_->_tmp5_;
#line 79 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 79 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _data_->os;
#line 79 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp6_ == NULL) {
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp7_ = NULL;
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp7_ = _data_->id;
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = NULL;
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->_tmp7_);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp8_;
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1347 "os-database.c"
			} else {
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1351 "os-database.c"
			}
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1357 "os-database.c"
		} else {
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 80 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1367 "os-database.c"
		}
	}
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->os;
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1376 "os-database.c"
	} else {
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1380 "os-database.c"
	}
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 82 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os);
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1392 "os-database.c"
	} else {
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1396 "os-database.c"
	}
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 74 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1402 "os-database.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 1409 "os-database.c"
}


static void _g_list_free__g_object_unref0_ (GList* self) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_list_free (self);
#line 1418 "os-database.c"
}


static void boxes_os_database_list_os_by_distro_data_free (gpointer _data) {
	BoxesOsDatabaseListOsByDistroData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->distro);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->after);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	__g_list_free__g_object_unref0_0 (_data_->result);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseListOsByDistroData, _data_);
#line 1435 "os-database.c"
}


static GDate* _g_date_dup (GDate* self) {
	GDate* dup;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	dup = g_new0 (GDate, 1);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	memcpy (dup, self, sizeof (GDate));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return dup;
#line 1447 "os-database.c"
}


static gpointer __g_date_dup0 (gpointer self) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return self ? _g_date_dup (self) : NULL;
#line 1454 "os-database.c"
}


void boxes_os_database_list_os_by_distro (BoxesOSDatabase* self, const gchar* distro, GDate* after, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseListOsByDistroData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GDate* _tmp3_ = NULL;
	GDate* _tmp4_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseListOsByDistroData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_list_os_by_distro);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_list_os_by_distro_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = distro;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->distro);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->distro = _tmp2_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = after;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = __g_date_dup0 (_tmp3_);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->after);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->after = _tmp4_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_list_os_by_distro_co (_data_);
#line 1493 "os-database.c"
}


GList* boxes_os_database_list_os_by_distro_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	GList* result;
	BoxesOsDatabaseListOsByDistroData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1504 "os-database.c"
	}
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 1514 "os-database.c"
}


static void boxes_os_database_list_os_by_distro_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseListOsByDistroData* _data_;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_list_os_by_distro_co (_data_);
#line 1528 "os-database.c"
}


static gint __lambda22_ (OsinfoOs* os_a, OsinfoOs* os_b) {
	gint result = 0;
	OsinfoOs* _tmp0_ = NULL;
	OsinfoReleaseStatus _tmp1_ = 0;
	GDate* release_a = NULL;
	OsinfoOs* _tmp4_ = NULL;
	GDate* _tmp5_ = NULL;
	GDate* release_b = NULL;
	OsinfoOs* _tmp6_ = NULL;
	GDate* _tmp7_ = NULL;
	GDate* _tmp8_ = NULL;
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os_a != NULL, 0);
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os_b != NULL, 0);
#line 115 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = os_a;
#line 115 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_os_get_release_status (_tmp0_);
#line 115 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp1_ != OSINFO_RELEASE_STATUS_RELEASED) {
#line 116 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = 1;
#line 116 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 1557 "os-database.c"
	} else {
		OsinfoOs* _tmp2_ = NULL;
		OsinfoReleaseStatus _tmp3_ = 0;
#line 117 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp2_ = os_b;
#line 117 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp3_ = osinfo_os_get_release_status (_tmp2_);
#line 117 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp3_ != OSINFO_RELEASE_STATUS_RELEASED) {
#line 118 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			result = -1;
#line 118 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return result;
#line 1571 "os-database.c"
		}
	}
#line 120 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = os_a;
#line 120 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = osinfo_product_get_release_date ((OsinfoProduct*) _tmp4_);
#line 120 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	release_a = _tmp5_;
#line 121 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = os_b;
#line 121 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp7_ = osinfo_product_get_release_date ((OsinfoProduct*) _tmp6_);
#line 121 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	release_b = _tmp7_;
#line 123 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp8_ = release_a;
#line 123 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp8_ == NULL) {
#line 124 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = 1;
#line 124 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_free0 (release_b);
#line 124 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_free0 (release_a);
#line 124 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 1598 "os-database.c"
	} else {
		GDate* _tmp9_ = NULL;
#line 125 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9_ = release_b;
#line 125 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp9_ == NULL) {
#line 126 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			result = -1;
#line 126 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_free0 (release_b);
#line 126 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_free0 (release_a);
#line 126 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return result;
#line 1613 "os-database.c"
		} else {
			GDate* _tmp10_ = NULL;
			GDate* _tmp11_ = NULL;
			GDate _tmp12_ = {0};
			gint _tmp13_ = 0;
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp10_ = release_a;
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp11_ = release_b;
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp12_ = *_tmp11_;
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp13_ = g_date_compare (_tmp10_, &_tmp12_);
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			result = _tmp13_;
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_free0 (release_b);
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_free0 (release_a);
#line 128 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return result;
#line 1635 "os-database.c"
		}
	}
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (release_b);
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_free0 (release_a);
#line 1642 "os-database.c"
}


static gint ___lambda22__gcompare_func (gconstpointer a, gconstpointer b) {
	gint result;
	result = __lambda22_ ((OsinfoOs*) a, (OsinfoOs*) b);
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 1651 "os-database.c"
}


static gboolean boxes_os_database_list_os_by_distro_co (BoxesOsDatabaseListOsByDistroData* _data_) {
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 1660 "os-database.c"
		goto _state_0;
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 1664 "os-database.c"
		goto _state_1;
		default:
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1669 "os-database.c"
	}
	_state_0:
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_list_os_by_distro_ready, _data_);
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1678 "os-database.c"
	_state_1:
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 92 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = NULL;
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = g_error_new_literal (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED, "Failed to load OS database");
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp1_;
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1702 "os-database.c"
			} else {
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1706 "os-database.c"
			}
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1712 "os-database.c"
		} else {
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 93 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1720 "os-database.c"
		}
	}
#line 95 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 95 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->self->priv->db;
#line 95 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 95 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_db_get_os_list (_data_->_tmp2_);
#line 95 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->os_list = _data_->_tmp3_;
#line 96 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = NULL;
#line 96 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = osinfo_filter_new ();
#line 96 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->filter = _data_->_tmp4_;
#line 97 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 97 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _data_->filter;
#line 97 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 97 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _data_->distro;
#line 97 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	osinfo_filter_add_constraint (_data_->_tmp5_, OSINFO_OS_PROP_DISTRO, _data_->_tmp6_);
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = NULL;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = _data_->os_list;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp8_ = NULL;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp8_ = _data_->filter;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp9_ = NULL;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp9_ = osinfo_list_new_filtered (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp7_, osinfo_list_get_type ()) ? ((OsinfoList*) _data_->_tmp7_) : NULL, _data_->_tmp8_);
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp10_ = NULL;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp10_ = G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp9_, osinfo_oslist_get_type ()) ? ((OsinfoOsList*) _data_->_tmp9_) : NULL;
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp10_ == NULL) {
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->_tmp9_);
#line 1769 "os-database.c"
	}
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_list);
#line 98 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->os_list = _data_->_tmp10_;
#line 100 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->after_list = NULL;
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp11_ = NULL;
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp11_ = _data_->os_list;
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp12_ = NULL;
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp12_ = osinfo_list_get_elements ((OsinfoList*) _data_->_tmp11_);
#line 1785 "os-database.c"
	{
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->entity_collection = _data_->_tmp12_;
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		for (_data_->entity_it = _data_->entity_collection; _data_->entity_it != NULL; _data_->entity_it = _data_->entity_it->next) {
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_data_->entity = (OsinfoEntity*) _data_->entity_it->data;
#line 1793 "os-database.c"
			{
#line 102 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp13_ = NULL;
#line 102 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp13_ = _data_->entity;
#line 102 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp14_ = NULL;
#line 102 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp13_, osinfo_os_get_type ()) ? ((OsinfoOs*) _data_->_tmp13_) : NULL);
#line 102 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->os = _data_->_tmp14_;
#line 104 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp15_ = NULL;
#line 104 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_data_->_tmp15_ = _data_->after;
#line 104 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				if (_data_->_tmp15_ != NULL) {
#line 105 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp16_ = NULL;
#line 105 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp16_ = _data_->os;
#line 105 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp17_ = NULL;
#line 105 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp17_ = osinfo_product_get_release_date ((OsinfoProduct*) _data_->_tmp16_);
#line 105 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->release_date = _data_->_tmp17_;
#line 106 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp18_ = NULL;
#line 106 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp18_ = _data_->os;
#line 106 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp19_ = 0;
#line 106 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp19_ = osinfo_os_get_release_status (_data_->_tmp18_);
#line 106 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->status = _data_->_tmp19_;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp21_ = 0;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp21_ = _data_->status;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					if (_data_->_tmp21_ != OSINFO_RELEASE_STATUS_RELEASED) {
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp20_ = TRUE;
#line 1839 "os-database.c"
					} else {
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp23_ = NULL;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp23_ = _data_->release_date;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						if (_data_->_tmp23_ != NULL) {
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp24_ = NULL;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp24_ = _data_->release_date;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp25_ = NULL;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp25_ = _data_->after;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							memset (&_data_->_tmp26_, 0, sizeof (GDate));
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp26_ = *_data_->_tmp25_;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp27_ = 0;
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp27_ = g_date_compare (_data_->_tmp24_, &_data_->_tmp26_);
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp22_ = _data_->_tmp27_ > 0;
#line 1865 "os-database.c"
						} else {
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
							_data_->_tmp22_ = FALSE;
#line 1869 "os-database.c"
						}
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp20_ = _data_->_tmp22_;
#line 1873 "os-database.c"
					}
#line 108 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					if (_data_->_tmp20_) {
#line 109 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp28_ = NULL;
#line 109 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp28_ = _data_->os;
#line 109 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp29_ = NULL;
#line 109 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->_tmp29_ = _g_object_ref0 (_data_->_tmp28_);
#line 109 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_data_->after_list = g_list_append (_data_->after_list, _data_->_tmp29_);
#line 1887 "os-database.c"
					}
#line 104 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_g_free0 (_data_->release_date);
#line 1891 "os-database.c"
				} else {
#line 111 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp30_ = NULL;
#line 111 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp30_ = _data_->os;
#line 111 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp31_ = NULL;
#line 111 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->_tmp31_ = _g_object_ref0 (_data_->_tmp30_);
#line 111 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_data_->after_list = g_list_append (_data_->after_list, _data_->_tmp31_);
#line 1903 "os-database.c"
				}
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (_data_->os);
#line 1907 "os-database.c"
			}
		}
#line 101 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_list_free0 (_data_->entity_collection);
#line 1912 "os-database.c"
	}
#line 114 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->after_list = g_list_sort (_data_->after_list, ___lambda22__gcompare_func);
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->after_list;
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->filter);
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_list);
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1926 "os-database.c"
	} else {
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1930 "os-database.c"
	}
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 131 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	__g_list_free__g_object_unref0_0 (_data_->after_list);
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->filter);
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_list);
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1946 "os-database.c"
	} else {
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1950 "os-database.c"
	}
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 91 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1956 "os-database.c"
}


OsinfoMedia* boxes_os_database_get_media_by_id (BoxesOSDatabase* self, OsinfoOs* os, const gchar* id, GError** error) {
	OsinfoMedia* result = NULL;
	OsinfoMediaList* medias = NULL;
	OsinfoOs* _tmp0_ = NULL;
	OsinfoMediaList* _tmp1_ = NULL;
	OsinfoMedia* media = NULL;
	OsinfoMediaList* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	OsinfoEntity* _tmp4_ = NULL;
	OsinfoMedia* _tmp5_ = NULL;
	OsinfoMedia* _tmp6_ = NULL;
	GError * _inner_error_ = NULL;
#line 134 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 134 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 134 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 135 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 135 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_os_get_media_list (_tmp0_);
#line 135 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	medias = _tmp1_;
#line 137 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = medias;
#line 137 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = id;
#line 137 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = osinfo_list_find_by_id ((OsinfoList*) _tmp2_, _tmp3_);
#line 137 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, osinfo_media_get_type ()) ? ((OsinfoMedia*) _tmp4_) : NULL);
#line 137 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	media = _tmp5_;
#line 138 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = media;
#line 138 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp6_ == NULL) {
#line 1998 "os-database.c"
		const gchar* _tmp7_ = NULL;
		GError* _tmp8_ = NULL;
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp7_ = id;
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID, "Unknown media ID '%s'", _tmp7_);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_inner_error_ = _tmp8_;
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_propagate_error (error, _inner_error_);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return NULL;
#line 2017 "os-database.c"
		} else {
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_clear_error (&_inner_error_);
#line 139 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			return NULL;
#line 2029 "os-database.c"
		}
	}
#line 141 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = media;
#line 141 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (medias);
#line 141 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2038 "os-database.c"
}


static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value) {
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 2049 "os-database.c"
	}
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 2055 "os-database.c"
}


static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value) {
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 2066 "os-database.c"
	}
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 2072 "os-database.c"
}


static gchar** _vala_array_dup3 (gchar** self, int length) {
	gchar** result;
	int i;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = g_new0 (gchar*, length + 1);
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	for (i = 0; i < length; i++) {
#line 2083 "os-database.c"
		gchar* _tmp0_ = NULL;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp0_ = g_strdup (self[i]);
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result[i] = _tmp0_;
#line 2089 "os-database.c"
	}
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2093 "os-database.c"
}


OsinfoResources* boxes_os_database_get_resources_for_os (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture) {
	OsinfoResources* result = NULL;
	OsinfoOs* _tmp0_ = NULL;
	gchar** architectures = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gint architectures_length1 = 0;
	gint _architectures_size_ = 0;
	gchar** prefs = NULL;
	gint prefs_length1 = 0;
	gint _prefs_size_ = 0;
	const gchar* _tmp7_ = NULL;
	OsinfoResourcesList* list = NULL;
	OsinfoOs* _tmp21_ = NULL;
	OsinfoResourcesList* _tmp22_ = NULL;
	OsinfoResources* recommended = NULL;
	OsinfoResourcesList* _tmp23_ = NULL;
	gchar** _tmp24_ = NULL;
	gint _tmp24__length1 = 0;
	OsinfoResources* _tmp25_ = NULL;
	OsinfoOs* _tmp26_ = NULL;
	OsinfoResourcesList* _tmp27_ = NULL;
	OsinfoResources* minimum = NULL;
	OsinfoResourcesList* _tmp28_ = NULL;
	gchar** _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	OsinfoResources* _tmp30_ = NULL;
	OsinfoResources* _tmp31_ = NULL;
	OsinfoResources* _tmp32_ = NULL;
	OsinfoResources* _tmp33_ = NULL;
#line 144 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 145 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 145 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp0_ == NULL) {
#line 2136 "os-database.c"
		OsinfoResources* _tmp1_ = NULL;
#line 146 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp1_ = boxes_os_database_get_default_resources ();
#line 146 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = _tmp1_;
#line 146 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 2144 "os-database.c"
	}
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup ("x86_64");
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_strdup ("i686");
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = g_strdup ("i386");
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = g_new0 (gchar*, 4 + 1);
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_[0] = _tmp2_;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_[1] = _tmp3_;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_[2] = _tmp4_;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_[3] = _tmp5_;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	architectures = _tmp6_;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	architectures_length1 = 4;
#line 149 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_architectures_size_ = architectures_length1;
#line 151 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp7_ = architecture;
#line 151 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp7_ != NULL) {
#line 2174 "os-database.c"
		gchar** _tmp8_ = NULL;
		gchar** _tmp9_ = NULL;
		gint _tmp9__length1 = 0;
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		gchar** _tmp12_ = NULL;
		gint _tmp12__length1 = 0;
#line 152 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_new0 (gchar*, 0 + 1);
#line 152 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 152 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs = _tmp8_;
#line 152 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs_length1 = 0;
#line 152 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9_ = prefs;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = prefs_length1;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp10_ = architecture;
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp11_ = g_strdup (_tmp10_);
#line 153 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_vala_array_add8 (&prefs, &prefs_length1, &_prefs_size_, _tmp11_);
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp12_ = architectures;
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp12__length1 = architectures_length1;
#line 2206 "os-database.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			arch_collection = _tmp12_;
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			arch_collection_length1 = _tmp12__length1;
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			for (arch_it = 0; arch_it < _tmp12__length1; arch_it = arch_it + 1) {
#line 2218 "os-database.c"
				gchar* _tmp13_ = NULL;
				gchar* arch = NULL;
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp13_ = g_strdup (arch_collection[arch_it]);
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				arch = _tmp13_;
#line 2225 "os-database.c"
				{
					const gchar* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
#line 156 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp14_ = arch;
#line 156 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp15_ = architecture;
#line 156 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					if (g_strcmp0 (_tmp14_, _tmp15_) != 0) {
#line 2235 "os-database.c"
						gchar** _tmp16_ = NULL;
						gint _tmp16__length1 = 0;
						const gchar* _tmp17_ = NULL;
						gchar* _tmp18_ = NULL;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_tmp16_ = prefs;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_tmp16__length1 = prefs_length1;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_tmp17_ = arch;
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_tmp18_ = g_strdup (_tmp17_);
#line 157 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
						_vala_array_add9 (&prefs, &prefs_length1, &_prefs_size_, _tmp18_);
#line 2250 "os-database.c"
					}
#line 155 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_g_free0 (arch);
#line 2254 "os-database.c"
				}
			}
		}
	} else {
		gchar** _tmp19_ = NULL;
		gint _tmp19__length1 = 0;
		gchar** _tmp20_ = NULL;
		gint _tmp20__length1 = 0;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp19_ = architectures;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp19__length1 = architectures_length1;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp20_ = (_tmp19_ != NULL) ? _vala_array_dup3 (_tmp19_, _tmp19__length1) : ((gpointer) _tmp19_);
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp20__length1 = _tmp19__length1;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs = _tmp20_;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		prefs_length1 = _tmp20__length1;
#line 159 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 2279 "os-database.c"
	}
#line 162 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp21_ = os;
#line 162 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp22_ = osinfo_os_get_recommended_resources (_tmp21_);
#line 162 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	list = _tmp22_;
#line 163 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp23_ = list;
#line 163 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp24_ = prefs;
#line 163 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp24__length1 = prefs_length1;
#line 163 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp25_ = boxes_os_database_get_prefered_resources (_tmp23_, _tmp24_, _tmp24__length1);
#line 163 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	recommended = _tmp25_;
#line 165 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp26_ = os;
#line 165 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp27_ = osinfo_os_get_minimum_resources (_tmp26_);
#line 165 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 165 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	list = _tmp27_;
#line 166 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp28_ = list;
#line 166 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp29_ = prefs;
#line 166 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp29__length1 = prefs_length1;
#line 166 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp30_ = boxes_os_database_get_prefered_resources (_tmp28_, _tmp29_, _tmp29__length1);
#line 166 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	minimum = _tmp30_;
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp31_ = minimum;
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp32_ = recommended;
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp33_ = boxes_os_database_get_resources_from_os_resources (self, _tmp31_, _tmp32_);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _tmp33_;
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (minimum);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (recommended);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	architectures = (_vala_array_free (architectures, architectures_length1, (GDestroyNotify) g_free), NULL);
#line 168 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2335 "os-database.c"
}


OsinfoResources* boxes_os_database_get_recommended_resources_for_os (OsinfoOs* os, const gchar* architecture) {
	OsinfoResources* result = NULL;
	gchar** prefs = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint prefs_length1 = 0;
	gint _prefs_size_ = 0;
	OsinfoResourcesList* list = NULL;
	OsinfoOs* _tmp4_ = NULL;
	OsinfoResourcesList* _tmp5_ = NULL;
	OsinfoResources* _tmp6_ = NULL;
#line 171 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 171 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (architecture != NULL, NULL);
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = architecture;
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_new0 (gchar*, 2 + 1);
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_[0] = _tmp1_;
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_[1] = _tmp2_;
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs = _tmp3_;
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs_length1 = 2;
#line 172 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_prefs_size_ = prefs_length1;
#line 174 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = os;
#line 174 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = osinfo_os_get_recommended_resources (_tmp4_);
#line 174 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	list = _tmp5_;
#line 176 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = boxes_os_database_get_prefered_resources (list, prefs, prefs_length1);
#line 176 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _tmp6_;
#line 176 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 176 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 176 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2390 "os-database.c"
}


OsinfoResources* boxes_os_database_get_minimum_resources_for_os (OsinfoOs* os, const gchar* architecture) {
	OsinfoResources* result = NULL;
	gchar** prefs = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint prefs_length1 = 0;
	gint _prefs_size_ = 0;
	OsinfoResourcesList* list = NULL;
	OsinfoOs* _tmp4_ = NULL;
	OsinfoResourcesList* _tmp5_ = NULL;
	OsinfoResources* _tmp6_ = NULL;
#line 179 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 179 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (architecture != NULL, NULL);
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = architecture;
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_new0 (gchar*, 2 + 1);
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_[0] = _tmp1_;
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_[1] = _tmp2_;
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs = _tmp3_;
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs_length1 = 2;
#line 180 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_prefs_size_ = prefs_length1;
#line 182 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = os;
#line 182 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = osinfo_os_get_minimum_resources (_tmp4_);
#line 182 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	list = _tmp5_;
#line 184 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = boxes_os_database_get_prefered_resources (list, prefs, prefs_length1);
#line 184 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _tmp6_;
#line 184 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 184 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 184 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2445 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_resources_from_os_resources (BoxesOSDatabase* self, OsinfoResources* minimum, OsinfoResources* recommended) {
	OsinfoResources* result = NULL;
	OsinfoResources* resources = NULL;
	OsinfoResources* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	OsinfoResources* _tmp2_ = NULL;
	gboolean _tmp23_ = FALSE;
	OsinfoResources* _tmp24_ = NULL;
	gboolean _tmp45_ = FALSE;
	OsinfoResources* _tmp46_ = NULL;
#line 187 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 188 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_os_database_get_default_resources ();
#line 188 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = recommended;
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp2_ != NULL) {
#line 2469 "os-database.c"
		OsinfoResources* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp3_ = recommended;
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp4_ = osinfo_resources_get_n_cpus (_tmp3_);
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp5_ = _tmp4_;
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp1_ = _tmp5_ > 0;
#line 2481 "os-database.c"
	} else {
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp1_ = FALSE;
#line 2485 "os-database.c"
	}
#line 191 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp1_) {
#line 2489 "os-database.c"
		OsinfoResources* _tmp6_ = NULL;
		OsinfoResources* _tmp7_ = NULL;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
#line 192 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp6_ = resources;
#line 192 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp7_ = recommended;
#line 192 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp8_ = osinfo_resources_get_n_cpus (_tmp7_);
#line 192 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9_ = _tmp8_;
#line 192 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_n_cpus (_tmp6_, _tmp9_);
#line 2504 "os-database.c"
	} else {
		gboolean _tmp10_ = FALSE;
		OsinfoResources* _tmp11_ = NULL;
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp11_ = minimum;
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp11_ != NULL) {
#line 2512 "os-database.c"
			OsinfoResources* _tmp12_ = NULL;
			gint _tmp13_ = 0;
			gint _tmp14_ = 0;
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp12_ = minimum;
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp13_ = osinfo_resources_get_n_cpus (_tmp12_);
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp14_ = _tmp13_;
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp10_ = _tmp14_ > 0;
#line 2524 "os-database.c"
		} else {
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp10_ = FALSE;
#line 2528 "os-database.c"
		}
#line 193 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp10_) {
#line 2532 "os-database.c"
			OsinfoResources* _tmp15_ = NULL;
			OsinfoResources* _tmp16_ = NULL;
			gint _tmp17_ = 0;
			gint _tmp18_ = 0;
			OsinfoResources* _tmp19_ = NULL;
			gint _tmp20_ = 0;
			gint _tmp21_ = 0;
			gint _tmp22_ = 0;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp15_ = resources;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp16_ = minimum;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp17_ = osinfo_resources_get_n_cpus (_tmp16_);
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp18_ = _tmp17_;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp19_ = resources;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp20_ = osinfo_resources_get_n_cpus (_tmp19_);
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp21_ = _tmp20_;
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp22_ = MAX (_tmp18_, _tmp21_);
#line 194 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_n_cpus (_tmp15_, _tmp22_);
#line 2559 "os-database.c"
		}
	}
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp24_ = recommended;
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp24_ != NULL) {
#line 2566 "os-database.c"
		OsinfoResources* _tmp25_ = NULL;
		gint64 _tmp26_ = 0LL;
		gint64 _tmp27_ = 0LL;
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp25_ = recommended;
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp26_ = osinfo_resources_get_ram (_tmp25_);
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp27_ = _tmp26_;
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp23_ = _tmp27_ > ((gint64) 0);
#line 2578 "os-database.c"
	} else {
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp23_ = FALSE;
#line 2582 "os-database.c"
	}
#line 197 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp23_) {
#line 2586 "os-database.c"
		OsinfoResources* _tmp28_ = NULL;
		OsinfoResources* _tmp29_ = NULL;
		gint64 _tmp30_ = 0LL;
		gint64 _tmp31_ = 0LL;
#line 198 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp28_ = resources;
#line 198 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp29_ = recommended;
#line 198 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp30_ = osinfo_resources_get_ram (_tmp29_);
#line 198 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp31_ = _tmp30_;
#line 198 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_ram (_tmp28_, _tmp31_);
#line 2601 "os-database.c"
	} else {
		gboolean _tmp32_ = FALSE;
		OsinfoResources* _tmp33_ = NULL;
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp33_ = minimum;
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp33_ != NULL) {
#line 2609 "os-database.c"
			OsinfoResources* _tmp34_ = NULL;
			gint64 _tmp35_ = 0LL;
			gint64 _tmp36_ = 0LL;
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp34_ = minimum;
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp35_ = osinfo_resources_get_ram (_tmp34_);
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp36_ = _tmp35_;
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp32_ = _tmp36_ > ((gint64) 0);
#line 2621 "os-database.c"
		} else {
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp32_ = FALSE;
#line 2625 "os-database.c"
		}
#line 199 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp32_) {
#line 2629 "os-database.c"
			OsinfoResources* _tmp37_ = NULL;
			OsinfoResources* _tmp38_ = NULL;
			gint64 _tmp39_ = 0LL;
			gint64 _tmp40_ = 0LL;
			OsinfoResources* _tmp41_ = NULL;
			gint64 _tmp42_ = 0LL;
			gint64 _tmp43_ = 0LL;
			gint64 _tmp44_ = 0LL;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp37_ = resources;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp38_ = minimum;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp39_ = osinfo_resources_get_ram (_tmp38_);
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp40_ = _tmp39_;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp41_ = resources;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp42_ = osinfo_resources_get_ram (_tmp41_);
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp43_ = _tmp42_;
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp44_ = MAX (_tmp40_, _tmp43_);
#line 200 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_ram (_tmp37_, _tmp44_);
#line 2656 "os-database.c"
		}
	}
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp46_ = recommended;
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp46_ != NULL) {
#line 2663 "os-database.c"
		OsinfoResources* _tmp47_ = NULL;
		gint64 _tmp48_ = 0LL;
		gint64 _tmp49_ = 0LL;
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp47_ = recommended;
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp48_ = osinfo_resources_get_storage (_tmp47_);
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp49_ = _tmp48_;
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp45_ = _tmp49_ > ((gint64) 0);
#line 2675 "os-database.c"
	} else {
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp45_ = FALSE;
#line 2679 "os-database.c"
	}
#line 203 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp45_) {
#line 2683 "os-database.c"
		OsinfoResources* _tmp50_ = NULL;
		OsinfoResources* _tmp51_ = NULL;
		gint64 _tmp52_ = 0LL;
		gint64 _tmp53_ = 0LL;
#line 204 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp50_ = resources;
#line 204 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp51_ = recommended;
#line 204 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp52_ = osinfo_resources_get_storage (_tmp51_);
#line 204 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp53_ = _tmp52_;
#line 204 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_storage (_tmp50_, _tmp53_);
#line 2698 "os-database.c"
	} else {
		gboolean _tmp54_ = FALSE;
		OsinfoResources* _tmp55_ = NULL;
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp55_ = minimum;
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp55_ != NULL) {
#line 2706 "os-database.c"
			OsinfoResources* _tmp56_ = NULL;
			gint64 _tmp57_ = 0LL;
			gint64 _tmp58_ = 0LL;
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp56_ = minimum;
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp57_ = osinfo_resources_get_storage (_tmp56_);
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp58_ = _tmp57_;
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp54_ = _tmp58_ > ((gint64) 0);
#line 2718 "os-database.c"
		} else {
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp54_ = FALSE;
#line 2722 "os-database.c"
		}
#line 205 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_tmp54_) {
#line 2726 "os-database.c"
			OsinfoResources* _tmp59_ = NULL;
			OsinfoResources* _tmp60_ = NULL;
			gint64 _tmp61_ = 0LL;
			gint64 _tmp62_ = 0LL;
			OsinfoResources* _tmp63_ = NULL;
			gint64 _tmp64_ = 0LL;
			gint64 _tmp65_ = 0LL;
			gint64 _tmp66_ = 0LL;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp59_ = resources;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp60_ = minimum;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp61_ = osinfo_resources_get_storage (_tmp60_);
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp62_ = _tmp61_;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp63_ = resources;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp64_ = osinfo_resources_get_storage (_tmp63_);
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp65_ = _tmp64_;
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			_tmp66_ = MAX (_tmp62_ * 2, _tmp65_);
#line 206 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_storage (_tmp59_, _tmp66_);
#line 2753 "os-database.c"
		}
	}
#line 208 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = resources;
#line 208 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2760 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_prefered_resources (OsinfoResourcesList* list, gchar** prefs, int prefs_length1) {
	OsinfoResources* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	OsinfoResourcesList* filtered = NULL;
	OsinfoResourcesList* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	const gchar* _tmp3_ = NULL;
	OsinfoResourcesList* _tmp4_ = NULL;
	OsinfoResourcesList* _tmp5_ = NULL;
	gint _tmp6_ = 0;
#line 211 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 212 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = prefs;
#line 212 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0__length1 = prefs_length1;
#line 212 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp0__length1 <= 0) {
#line 213 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = NULL;
#line 213 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 2788 "os-database.c"
	}
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = list;
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = prefs;
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2__length1 = prefs_length1;
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp3_ = _tmp2_[0];
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp4_ = boxes_os_database_filter_resources_list_by_arch (_tmp1_, _tmp3_);
#line 215 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	filtered = _tmp4_;
#line 216 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp5_ = filtered;
#line 216 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp6_ = osinfo_list_get_length ((OsinfoList*) _tmp5_);
#line 216 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_tmp6_ <= 0) {
#line 2808 "os-database.c"
		OsinfoResourcesList* _tmp7_ = NULL;
		gchar** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gchar** _tmp9_ = NULL;
		gint _tmp9__length1 = 0;
		OsinfoResources* _tmp10_ = NULL;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp7_ = list;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp8_ = prefs;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp8__length1 = prefs_length1;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9_ = prefs;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = prefs_length1;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp10_ = boxes_os_database_get_prefered_resources (_tmp7_, _tmp8_ + 1, _tmp9__length1 - 1);
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = _tmp10_;
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 217 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 2833 "os-database.c"
	} else {
		OsinfoResourcesList* _tmp11_ = NULL;
		OsinfoEntity* _tmp12_ = NULL;
		OsinfoResources* _tmp13_ = NULL;
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp11_ = filtered;
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp12_ = osinfo_list_get_nth ((OsinfoList*) _tmp11_, 0);
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp12_) : NULL);
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		result = _tmp13_;
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 221 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return result;
#line 2850 "os-database.c"
	}
#line 211 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (filtered);
#line 2854 "os-database.c"
}


static OsinfoResourcesList* boxes_os_database_filter_resources_list_by_arch (OsinfoResourcesList* list, const gchar* arch) {
	OsinfoResourcesList* result = NULL;
	OsinfoResourcesList* new_list = NULL;
	OsinfoResourcesList* _tmp0_ = NULL;
	OsinfoResourcesList* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
#line 224 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 224 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (arch != NULL, NULL);
#line 225 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resourceslist_new ();
#line 225 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	new_list = _tmp0_;
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp1_ = list;
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp2_ = osinfo_list_get_elements ((OsinfoList*) _tmp1_);
#line 2876 "os-database.c"
	{
		GList* entity_collection = NULL;
		GList* entity_it = NULL;
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		entity_collection = _tmp2_;
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		for (entity_it = entity_collection; entity_it != NULL; entity_it = entity_it->next) {
#line 2884 "os-database.c"
			OsinfoEntity* entity = NULL;
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			entity = (OsinfoEntity*) entity_it->data;
#line 2888 "os-database.c"
			{
				OsinfoResources* resources = NULL;
				OsinfoEntity* _tmp3_ = NULL;
				OsinfoResources* _tmp4_ = NULL;
				BoxesCPUArchCompatibility compatibility = 0;
				const gchar* _tmp5_ = NULL;
				OsinfoResources* _tmp6_ = NULL;
				const gchar* _tmp7_ = NULL;
				const gchar* _tmp8_ = NULL;
				BoxesCPUArchCompatibility _tmp9_ = 0;
				gboolean _tmp10_ = FALSE;
				BoxesCPUArchCompatibility _tmp11_ = 0;
#line 227 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp3_ = entity;
#line 227 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp3_) : NULL);
#line 227 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				resources = _tmp4_;
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp5_ = arch;
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp6_ = resources;
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp7_ = osinfo_resources_get_architecture (_tmp6_);
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp8_ = _tmp7_;
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp9_ = boxes_compare_cpu_architectures (_tmp5_, _tmp8_);
#line 228 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				compatibility = _tmp9_;
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_tmp11_ = compatibility;
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				if (_tmp11_ == BOXES_CPU_ARCH_COMPATIBILITY_IDENTICAL) {
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp10_ = TRUE;
#line 2925 "os-database.c"
				} else {
					BoxesCPUArchCompatibility _tmp12_ = 0;
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp12_ = compatibility;
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp10_ = _tmp12_ == BOXES_CPU_ARCH_COMPATIBILITY_COMPATIBLE;
#line 2932 "os-database.c"
				}
#line 229 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				if (_tmp10_) {
#line 2936 "os-database.c"
					OsinfoResourcesList* _tmp13_ = NULL;
					OsinfoResources* _tmp14_ = NULL;
#line 230 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp13_ = new_list;
#line 230 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					_tmp14_ = resources;
#line 230 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
					osinfo_list_add ((OsinfoList*) _tmp13_, (OsinfoEntity*) _tmp14_);
#line 2945 "os-database.c"
				}
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (resources);
#line 2949 "os-database.c"
			}
		}
#line 226 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_list_free0 (entity_collection);
#line 2954 "os-database.c"
	}
#line 233 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = new_list;
#line 233 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 2960 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	_data_ = _data;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseEnsureDbLoadedData, _data_);
#line 2971 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseEnsureDbLoadedData);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_ensure_db_loaded);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_ensure_db_loaded_data_free);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data_);
#line 2990 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	gboolean result;
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return result;
#line 3003 "os-database.c"
}


static Block57Data* block57_data_ref (Block57Data* _data57_) {
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data57_->_ref_count_);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return _data57_;
#line 3012 "os-database.c"
}


static void block57_data_unref (void * _userdata_) {
	Block57Data* _data57_;
	_data57_ = (Block57Data*) _userdata_;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data57_->_ref_count_)) {
#line 3021 "os-database.c"
		BoxesOSDatabase* self;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		self = _data57_->self;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_slice_free (Block57Data, _data57_);
#line 3029 "os-database.c"
	}
}


static Block58Data* block58_data_ref (Block58Data* _data58_) {
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data58_->_ref_count_);
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return _data58_;
#line 3039 "os-database.c"
}


static void block58_data_unref (void * _userdata_) {
	Block58Data* _data58_;
	_data58_ = (Block58Data*) _userdata_;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data58_->_ref_count_)) {
#line 3048 "os-database.c"
		BoxesOSDatabase* self;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		self = _data58_->_data57_->self;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		block57_data_unref (_data58_->_data57_);
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data58_->_data57_ = NULL;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_slice_free (Block58Data, _data58_);
#line 3058 "os-database.c"
	}
}


static void ___lambda21_ (Block58Data* _data58_) {
	Block57Data* _data57_;
	BoxesOSDatabase* self;
	gulong _tmp0_ = 0UL;
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data57_ = _data58_->_data57_;
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self = _data57_->self;
#line 244 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data57_->_async_data_);
#line 245 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_tmp0_ = _data58_->db_loaded_id;
#line 245 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_signal_handler_disconnect ((GObject*) self, _tmp0_);
#line 3077 "os-database.c"
}


static void ____lambda21__boxes_os_database_db_loaded (BoxesOSDatabase* _sender, gpointer self) {
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	___lambda21_ (self);
#line 3084 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_) {
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 0:
#line 3093 "os-database.c"
		goto _state_0;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		case 1:
#line 3097 "os-database.c"
		goto _state_1;
		default:
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 3102 "os-database.c"
	}
	_state_0:
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_ = g_slice_new0 (Block57Data);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_->_ref_count_ = 1;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_->self = g_object_ref (_data_->self);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_->_async_data_ = _data_;
#line 237 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = NULL;
#line 237 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = _data_->self->priv->db;
#line 237 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp0_ != NULL) {
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->result = TRUE;
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		block57_data_unref (_data_->_data57_);
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data57_ = NULL;
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 3129 "os-database.c"
		} else {
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 3133 "os-database.c"
		}
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 238 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 3139 "os-database.c"
	}
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = FALSE;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db_loading;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp1_) {
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_ = g_slice_new0 (Block58Data);
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_->_ref_count_ = 1;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_->_data57_ = block57_data_ref (_data_->_data57_);
#line 241 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_->db_loaded_id = (gulong) 0;
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = 0UL;
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_signal_connect_data (_data_->self, "db-loaded", (GCallback) ____lambda21__boxes_os_database_db_loaded, block58_data_ref (_data_->_data58_), (GClosureNotify) block58_data_unref, 0);
#line 243 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_->db_loaded_id = _data_->_tmp2_;
#line 248 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 248 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 3165 "os-database.c"
		_state_1:
		;
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		block58_data_unref (_data_->_data58_);
#line 240 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		_data_->_data58_ = NULL;
#line 3172 "os-database.c"
	}
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp3_ != NULL;
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	block57_data_unref (_data_->_data57_);
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_ = NULL;
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 3188 "os-database.c"
	} else {
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 3192 "os-database.c"
	}
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 251 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	block57_data_unref (_data_->_data57_);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_data_->_data57_ = NULL;
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 3206 "os-database.c"
	} else {
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 3210 "os-database.c"
	}
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 236 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 3216 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_construct (GType object_type) {
	BoxesOSDatabase * self = NULL;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self = (BoxesOSDatabase*) g_object_new (object_type, NULL);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return self;
#line 3226 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_new (void) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	return boxes_os_database_construct (BOXES_TYPE_OS_DATABASE);
#line 3233 "os-database.c"
}


static void boxes_os_database_class_init (BoxesOSDatabaseClass * klass) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	boxes_os_database_parent_class = g_type_class_peek_parent (klass);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_type_class_add_private (klass, sizeof (BoxesOSDatabasePrivate));
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_os_database_finalize;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	g_signal_new ("db_loaded", BOXES_TYPE_OS_DATABASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 3246 "os-database.c"
}


static void boxes_os_database_instance_init (BoxesOSDatabase * self) {
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self->priv = BOXES_OS_DATABASE_GET_PRIVATE (self);
#line 3253 "os-database.c"
}


static void boxes_os_database_finalize (GObject* obj) {
	BoxesOSDatabase * self;
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OS_DATABASE, BoxesOSDatabase);
#line 20 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (self->priv->db);
#line 12 "/home/mclasen/Sources/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (boxes_os_database_parent_class)->finalize (obj);
#line 3265 "os-database.c"
}


GType boxes_os_database_get_type (void) {
	static volatile gsize boxes_os_database_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_os_database_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesOSDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_os_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesOSDatabase), 0, (GInstanceInitFunc) boxes_os_database_instance_init, NULL };
		GType boxes_os_database_type_id;
		boxes_os_database_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesOSDatabase", &g_define_type_info, 0);
		g_once_init_leave (&boxes_os_database_type_id__volatile, boxes_os_database_type_id);
	}
	return boxes_os_database_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 3284 "os-database.c"
		int i;
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
				destroy_func (((gpointer*) array)[i]);
#line 3292 "os-database.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 476 "/home/mclasen/Sources/gnome-boxes/src/libvirt-machine.vala"
	g_free (array);
#line 3304 "os-database.c"
}



