/* os-database.c generated by valac 0.21.2, 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 _Block47Data Block47Data;
#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 BOXES_TYPE_CPU_ARCH_COMPATIBILITY (boxes_cpu_arch_compatibility_get_type ())
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _Block48Data Block48Data;
typedef struct _Block49Data Block49Data;
typedef struct _BoxesOsDatabaseEnsureDbLoadedData BoxesOsDatabaseEnsureDbLoadedData;

typedef enum  {
	BOXES_OS_DATABASE_ERROR_NON_BOOTABLE,
	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 _Block47Data {
	int _ref_count_;
	BoxesOSDatabase * self;
	OsinfoLoader* loader;
	gpointer _async_data_;
};

struct _BoxesOsDatabaseLoadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	Block47Data* _data47_;
	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_;
	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_;
	const gchar* _tmp1_;
	GError* _tmp2_;
	OsinfoOs* os;
	OsinfoDb* _tmp3_;
	const gchar* _tmp4_;
	OsinfoOs* _tmp5_;
	OsinfoOs* _tmp6_;
	OsinfoOs* _tmp7_;
	const gchar* _tmp8_;
	GError* _tmp9_;
	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 _Block48Data {
	int _ref_count_;
	BoxesOSDatabase * self;
	gpointer _async_data_;
};

struct _Block49Data {
	int _ref_count_;
	Block48Data * _data48_;
	gulong db_loaded_id;
};

struct _BoxesOsDatabaseEnsureDbLoadedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gboolean result;
	Block48Data* _data48_;
	OsinfoDb* _tmp0_;
	gboolean _tmp1_;
	Block49Data* _data49_;
	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 Block47Data* block47_data_ref (Block47Data* _data47_);
static void block47_data_unref (void * _userdata_);
static void ___lambda38_ (Block47Data* _data47_, GError** error);
static void ____lambda38__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 ___lambda39_ (Block47Data* _data47_, GError** error);
static void ____lambda39__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_);
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_add6 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add7 (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 (BoxesOSDatabase* self, 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 (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture);
static OsinfoResourcesList* boxes_os_database_filter_resources_list_by_arch (BoxesOSDatabase* self, 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 Block48Data* block48_data_ref (Block48Data* _data48_);
static void block48_data_unref (void * _userdata_);
static Block49Data* block49_data_ref (Block49Data* _data49_);
static void block49_data_unref (void * _userdata_);
static void ___lambda40_ (Block49Data* _data49_);
static void ____lambda40__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 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	return g_quark_from_static_string ("boxes_os_database_error-quark");
#line 249 "os-database.c"
}


OsinfoResources* boxes_os_database_get_default_resources (void) {
	OsinfoResources* result = NULL;
	OsinfoResources* resources = NULL;
	OsinfoResources* _tmp0_ = NULL;
#line 26 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resources_new ("whatever", "x86_64");
#line 26 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_n_cpus (resources, BOXES_OS_DATABASE_DEFAULT_VCPUS);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_ram (resources, BOXES_OS_DATABASE_DEFAULT_RAM);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_storage (resources, BOXES_OS_DATABASE_DEFAULT_STORAGE);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = resources;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 271 "os-database.c"
}


static void boxes_os_database_load_data_free (gpointer _data) {
	BoxesOsDatabaseLoadData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseLoadData, _data_);
#line 282 "os-database.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return self ? g_object_ref (self) : NULL;
#line 289 "os-database.c"
}


void boxes_os_database_load (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseLoadData);
#line 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 308 "os-database.c"
}


void boxes_os_database_load_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	BoxesOsDatabaseLoadData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 316 "os-database.c"
}


static Block47Data* block47_data_ref (Block47Data* _data47_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data47_->_ref_count_);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data47_;
#line 325 "os-database.c"
}


static void block47_data_unref (void * _userdata_) {
	Block47Data* _data47_;
	_data47_ = (Block47Data*) _userdata_;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data47_->_ref_count_)) {
#line 334 "os-database.c"
		BoxesOSDatabase * self;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data47_->self;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data47_->loader);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block47Data, _data47_);
#line 344 "os-database.c"
	}
}


static void ___lambda38_ (Block47Data* _data47_, GError** error) {
	BoxesOSDatabase * self;
	GError * _inner_error_ = NULL;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data47_->self;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_default_path (_data47_->loader, &_inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_inner_error_ != NULL) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return;
#line 362 "os-database.c"
	}
}


static void ____lambda38__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda38_ (self, error);
#line 370 "os-database.c"
}


static void boxes_os_database_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 384 "os-database.c"
}


static void ___lambda39_ (Block47Data* _data47_, GError** error) {
	BoxesOSDatabase * self;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data47_->self;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_get_logos_db ();
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = _tmp0_;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_path (_data47_->loader, _tmp1_, &_inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_tmp1_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_inner_error_ != NULL) {
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return;
#line 409 "os-database.c"
	}
}


static void ____lambda39__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda39_ (self, error);
#line 417 "os-database.c"
}


static gboolean boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 426 "os-database.c"
		goto _state_0;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 430 "os-database.c"
		goto _state_1;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 2:
#line 434 "os-database.c"
		goto _state_2;
		default:
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 439 "os-database.c"
	}
	_state_0:
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_ = g_slice_new0 (Block47Data);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_->_ref_count_ = 1;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_->self = g_object_ref (_data_->self);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_->_async_data_ = _data_;
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = TRUE;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = osinfo_loader_new ();
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_->loader = _data_->_tmp0_;
#line 458 "os-database.c"
	{
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda38__boxes_run_in_thread_func, block47_data_ref (_data_->_data47_), block47_data_unref, NULL, boxes_os_database_load_ready, _data_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 466 "os-database.c"
		_state_1:
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_ != NULL) {
#line 472 "os-database.c"
			goto __catch63_g_error;
		}
	}
	goto __finally63;
	__catch63_g_error:
	{
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->e = _data_->_inner_error_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = NULL;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _data_->e;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = NULL;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = _data_->_tmp1_->message;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:41: Error loading default libosinfo database: %s", _data_->_tmp2_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->e);
#line 495 "os-database.c"
	}
	__finally63:
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block47_data_unref (_data_->_data47_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data47_ = NULL;
#line 38 "/extra-data/checkout/gnome/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 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 510 "os-database.c"
	}
	{
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 2;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda39__boxes_run_in_thread_func, block47_data_ref (_data_->_data47_), block47_data_unref, NULL, boxes_os_database_load_ready, _data_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 519 "os-database.c"
		_state_2:
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_ != NULL) {
#line 525 "os-database.c"
			goto __catch64_g_error;
		}
	}
	goto __finally64;
	__catch64_g_error:
	{
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_vala1_e = _data_->_inner_error_;
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = NULL;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = _data_->_vala1_e;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = NULL;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:46: Error loading GNOME Boxes libosinfo database: %s", _data_->_tmp4_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->_vala1_e);
#line 548 "os-database.c"
	}
	__finally64:
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block47_data_unref (_data_->_data47_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data47_ = NULL;
#line 43 "/extra-data/checkout/gnome/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 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 563 "os-database.c"
	}
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_loader_get_db (_data_->_data47_->loader);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self->priv->db);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db = _data_->_tmp6_;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = FALSE;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_signal_emit_by_name (_data_->self, "db-loaded");
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block47_data_unref (_data_->_data47_);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data47_ = NULL;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 589 "os-database.c"
	} else {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 593 "os-database.c"
	}
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 599 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_path_data_free (gpointer _data) {
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGuessOsFromInstallMediaPathData, _data_);
#line 616 "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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaPathData);
#line 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = media_path;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->media_path = _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = cancellable;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->cancellable = _tmp4_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_path_co (_data_);
#line 655 "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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return NULL;
#line 666 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 676 "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 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_path_co (_data_);
#line 690 "os-database.c"
}


static gboolean boxes_os_database_guess_os_from_install_media_path_co (BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 699 "os-database.c"
		goto _state_0;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 703 "os-database.c"
		goto _state_1;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 2:
#line 707 "os-database.c"
		goto _state_2;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 3:
#line 711 "os-database.c"
		goto _state_3;
		default:
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 716 "os-database.c"
	}
	_state_0:
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 55 "/extra-data/checkout/gnome/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 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 725 "os-database.c"
	_state_1:
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 739 "os-database.c"
		} else {
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 743 "os-database.c"
		}
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 749 "os-database.c"
	}
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = NULL;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->media_path;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->cancellable;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 2;
#line 58 "/extra-data/checkout/gnome/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 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 765 "os-database.c"
	_state_2:
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_media_create_from_location_finish (_data_->_res_, &_data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->media = _data_->_tmp3_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_error_free (_data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 783 "os-database.c"
		} else {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 787 "os-database.c"
		}
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 793 "os-database.c"
	}
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _data_->media;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 3;
#line 60 "/extra-data/checkout/gnome/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 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 805 "os-database.c"
	_state_3:
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 60 "/extra-data/checkout/gnome/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 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->_tmp6_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_error_free (_data_->_inner_error_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->media);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 825 "os-database.c"
		} else {
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 829 "os-database.c"
		}
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 835 "os-database.c"
	}
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp4_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 845 "os-database.c"
	} else {
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 849 "os-database.c"
	}
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 861 "os-database.c"
	} else {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 865 "os-database.c"
	}
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 871 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_data_free (gpointer _data) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGuessOsFromInstallMediaData, _data_);
#line 886 "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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaData);
#line 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = media;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->media = _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 915 "os-database.c"
}


OsinfoMedia* boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoMedia* result;
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return NULL;
#line 926 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 936 "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 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 950 "os-database.c"
}


static gboolean boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 959 "os-database.c"
		goto _state_0;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 963 "os-database.c"
		goto _state_1;
		default:
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 968 "os-database.c"
	}
	_state_0:
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 64 "/extra-data/checkout/gnome/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 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 977 "os-database.c"
	_state_1:
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 991 "os-database.c"
		} else {
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 995 "os-database.c"
		}
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 65 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1001 "os-database.c"
	}
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = NULL;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = NULL;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->media;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = FALSE;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_db_identify_media (_data_->_tmp1_, _data_->_tmp2_);
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp3_) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = NULL;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->media;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = NULL;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = _data_->_tmp5_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1031 "os-database.c"
		} else {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1035 "os-database.c"
		}
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1041 "os-database.c"
	}
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1049 "os-database.c"
	} else {
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1053 "os-database.c"
	}
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1063 "os-database.c"
	} else {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1067 "os-database.c"
	}
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1073 "os-database.c"
}


static void boxes_os_database_get_os_by_id_data_free (gpointer _data) {
	BoxesOsDatabaseGetOsByIdData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGetOsByIdData, _data_);
#line 1088 "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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGetOsByIdData);
#line 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = id;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->id = _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 1117 "os-database.c"
}


OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoOs* result;
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1128 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1138 "os-database.c"
}


static void boxes_os_database_get_os_by_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 1152 "os-database.c"
}


static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_) {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 1161 "os-database.c"
		goto _state_0;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 1165 "os-database.c"
		goto _state_1;
		default:
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1170 "os-database.c"
	}
	_state_0:
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_get_os_by_id_ready, _data_);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1179 "os-database.c"
	_state_1:
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = NULL;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _data_->id;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = NULL;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->_tmp1_);
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp2_;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1207 "os-database.c"
			} else {
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1211 "os-database.c"
			}
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1217 "os-database.c"
		} else {
#line 75 "/extra-data/checkout/gnome/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 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1225 "os-database.c"
		}
	}
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = NULL;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->id;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_db_get_os (_data_->_tmp3_, _data_->_tmp4_);
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->os = _data_->_tmp6_;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = NULL;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = _data_->os;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp7_ == NULL) {
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = NULL;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = _data_->id;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp9_ = NULL;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp9_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->_tmp8_);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp9_;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1274 "os-database.c"
			} else {
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1278 "os-database.c"
			}
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1284 "os-database.c"
		} else {
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 79 "/extra-data/checkout/gnome/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 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1294 "os-database.c"
		}
	}
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->os;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1303 "os-database.c"
	} else {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1307 "os-database.c"
	}
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os);
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1319 "os-database.c"
	} else {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1323 "os-database.c"
	}
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1329 "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 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_os_get_media_list (_tmp0_);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	medias = _tmp1_;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = medias;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = id;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = osinfo_list_find_by_id ((OsinfoList*) _tmp2_, _tmp3_);
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, osinfo_media_get_type ()) ? ((OsinfoMedia*) _tmp4_) : NULL);
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	media = _tmp5_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = media;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp6_ == NULL) {
#line 1371 "os-database.c"
		const gchar* _tmp7_ = NULL;
		GError* _tmp8_ = NULL;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp7_ = id;
#line 89 "/extra-data/checkout/gnome/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 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_inner_error_ = _tmp8_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_propagate_error (error, _inner_error_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return NULL;
#line 1390 "os-database.c"
		} else {
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 89 "/extra-data/checkout/gnome/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 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_inner_error_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return NULL;
#line 1402 "os-database.c"
		}
	}
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = media;
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (medias);
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1411 "os-database.c"
}


static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1422 "os-database.c"
	}
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 1428 "os-database.c"
}


static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1439 "os-database.c"
	}
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 1445 "os-database.c"
}


static gchar** _vala_array_dup3 (gchar** self, int length) {
	gchar** result;
	int i;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = g_new0 (gchar*, length + 1);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	for (i = 0; i < length; i++) {
#line 1456 "os-database.c"
		gchar* _tmp0_ = NULL;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp0_ = g_strdup (self[i]);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result[i] = _tmp0_;
#line 1462 "os-database.c"
	}
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1466 "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 94 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp0_ == NULL) {
#line 1509 "os-database.c"
		OsinfoResources* _tmp1_ = NULL;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = boxes_os_database_get_default_resources ();
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp1_;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 1517 "os-database.c"
	}
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup ("x86_64");
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_strdup ("i686");
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = g_strdup ("i386");
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = g_new0 (gchar*, 4 + 1);
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[0] = _tmp2_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[1] = _tmp3_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[2] = _tmp4_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[3] = _tmp5_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures = _tmp6_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures_length1 = 4;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_architectures_size_ = architectures_length1;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp7_ = architecture;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp7_ != NULL) {
#line 1547 "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 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_new0 (gchar*, 0 + 1);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = _tmp8_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs_length1 = 0;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9_ = prefs;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = prefs_length1;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = architecture;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp11_ = g_strdup (_tmp10_);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_vala_array_add6 (&prefs, &prefs_length1, &_prefs_size_, _tmp11_);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = architectures;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12__length1 = architectures_length1;
#line 1579 "os-database.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			arch_collection = _tmp12_;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			arch_collection_length1 = _tmp12__length1;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			for (arch_it = 0; arch_it < _tmp12__length1; arch_it = arch_it + 1) {
#line 1591 "os-database.c"
				gchar* _tmp13_ = NULL;
				gchar* arch = NULL;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp13_ = g_strdup (arch_collection[arch_it]);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				arch = _tmp13_;
#line 1598 "os-database.c"
				{
					const gchar* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp14_ = arch;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp15_ = architecture;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					if (g_strcmp0 (_tmp14_, _tmp15_) != 0) {
#line 1608 "os-database.c"
						gchar** _tmp16_ = NULL;
						gint _tmp16__length1 = 0;
						const gchar* _tmp17_ = NULL;
						gchar* _tmp18_ = NULL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp16_ = prefs;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp16__length1 = prefs_length1;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp17_ = arch;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp18_ = g_strdup (_tmp17_);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_vala_array_add7 (&prefs, &prefs_length1, &_prefs_size_, _tmp18_);
#line 1623 "os-database.c"
					}
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_g_free0 (arch);
#line 1627 "os-database.c"
				}
			}
		}
	} else {
		gchar** _tmp19_ = NULL;
		gint _tmp19__length1 = 0;
		gchar** _tmp20_ = NULL;
		gint _tmp20__length1 = 0;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp19_ = architectures;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp19__length1 = architectures_length1;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp20_ = (_tmp19_ != NULL) ? _vala_array_dup3 (_tmp19_, _tmp19__length1) : ((gpointer) _tmp19_);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp20__length1 = _tmp19__length1;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = _tmp20_;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs_length1 = _tmp20__length1;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 1652 "os-database.c"
	}
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp21_ = os;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp22_ = osinfo_os_get_recommended_resources (_tmp21_);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	list = _tmp22_;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp23_ = list;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp24_ = prefs;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp24__length1 = prefs_length1;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp25_ = boxes_os_database_get_prefered_resources (self, _tmp23_, _tmp24_, _tmp24__length1);
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	recommended = _tmp25_;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp26_ = os;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp27_ = osinfo_os_get_minimum_resources (_tmp26_);
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	list = _tmp27_;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp28_ = list;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp29_ = prefs;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp29__length1 = prefs_length1;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp30_ = boxes_os_database_get_prefered_resources (self, _tmp28_, _tmp29_, _tmp29__length1);
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	minimum = _tmp30_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp31_ = minimum;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp32_ = recommended;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp33_ = boxes_os_database_get_resources_from_os_resources (self, _tmp31_, _tmp32_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _tmp33_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (minimum);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (recommended);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures = (_vala_array_free (architectures, architectures_length1, (GDestroyNotify) g_free), NULL);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1708 "os-database.c"
}


OsinfoResources* boxes_os_database_get_recommended_resources_for_os (BoxesOSDatabase* self, 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 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (architecture != NULL, NULL);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = architecture;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_new0 (gchar*, 2 + 1);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_[0] = _tmp1_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_[1] = _tmp2_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	prefs = _tmp3_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	prefs_length1 = 2;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_prefs_size_ = prefs_length1;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = os;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = osinfo_os_get_recommended_resources (_tmp4_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	list = _tmp5_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = boxes_os_database_get_prefered_resources (self, list, prefs, prefs_length1);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _tmp6_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1765 "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 _tmp6_ = FALSE;
	gboolean _tmp25_ = FALSE;
	OsinfoResources* _tmp26_ = NULL;
	gboolean _tmp30_ = FALSE;
	gboolean _tmp49_ = FALSE;
	OsinfoResources* _tmp50_ = NULL;
	gboolean _tmp54_ = FALSE;
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_os_database_get_default_resources ();
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = recommended;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp2_ != NULL) {
#line 1792 "os-database.c"
		OsinfoResources* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp3_ = recommended;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp4_ = osinfo_resources_get_n_cpus (_tmp3_);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp5_ = _tmp4_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = _tmp5_ > 0;
#line 1804 "os-database.c"
	} else {
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = FALSE;
#line 1808 "os-database.c"
	}
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = _tmp1_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp6_) {
#line 1814 "os-database.c"
		OsinfoResources* _tmp7_ = NULL;
		OsinfoResources* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp7_ = resources;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = recommended;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9_ = osinfo_resources_get_n_cpus (_tmp8_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = _tmp9_;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_n_cpus (_tmp7_, _tmp10_);
#line 1829 "os-database.c"
	} else {
		gboolean _tmp11_ = FALSE;
		OsinfoResources* _tmp12_ = NULL;
		gboolean _tmp16_ = FALSE;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = minimum;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp12_ != NULL) {
#line 1838 "os-database.c"
			OsinfoResources* _tmp13_ = NULL;
			gint _tmp14_ = 0;
			gint _tmp15_ = 0;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp13_ = minimum;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp14_ = osinfo_resources_get_n_cpus (_tmp13_);
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp15_ = _tmp14_;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp11_ = _tmp15_ > 0;
#line 1850 "os-database.c"
		} else {
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp11_ = FALSE;
#line 1854 "os-database.c"
		}
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp16_ = _tmp11_;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp16_) {
#line 1860 "os-database.c"
			OsinfoResources* _tmp17_ = NULL;
			OsinfoResources* _tmp18_ = NULL;
			gint _tmp19_ = 0;
			gint _tmp20_ = 0;
			OsinfoResources* _tmp21_ = NULL;
			gint _tmp22_ = 0;
			gint _tmp23_ = 0;
			gint _tmp24_ = 0;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp17_ = resources;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp18_ = minimum;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp19_ = osinfo_resources_get_n_cpus (_tmp18_);
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp20_ = _tmp19_;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp21_ = resources;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp22_ = osinfo_resources_get_n_cpus (_tmp21_);
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp23_ = _tmp22_;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp24_ = MAX (_tmp20_, _tmp23_);
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_n_cpus (_tmp17_, _tmp24_);
#line 1887 "os-database.c"
		}
	}
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp26_ = recommended;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp26_ != NULL) {
#line 1894 "os-database.c"
		OsinfoResources* _tmp27_ = NULL;
		gint64 _tmp28_ = 0LL;
		gint64 _tmp29_ = 0LL;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp27_ = recommended;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp28_ = osinfo_resources_get_ram (_tmp27_);
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp29_ = _tmp28_;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp25_ = _tmp29_ > ((gint64) 0);
#line 1906 "os-database.c"
	} else {
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp25_ = FALSE;
#line 1910 "os-database.c"
	}
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp30_ = _tmp25_;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp30_) {
#line 1916 "os-database.c"
		OsinfoResources* _tmp31_ = NULL;
		OsinfoResources* _tmp32_ = NULL;
		gint64 _tmp33_ = 0LL;
		gint64 _tmp34_ = 0LL;
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp31_ = resources;
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp32_ = recommended;
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp33_ = osinfo_resources_get_ram (_tmp32_);
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp34_ = _tmp33_;
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_ram (_tmp31_, _tmp34_);
#line 1931 "os-database.c"
	} else {
		gboolean _tmp35_ = FALSE;
		OsinfoResources* _tmp36_ = NULL;
		gboolean _tmp40_ = FALSE;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp36_ = minimum;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp36_ != NULL) {
#line 1940 "os-database.c"
			OsinfoResources* _tmp37_ = NULL;
			gint64 _tmp38_ = 0LL;
			gint64 _tmp39_ = 0LL;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp37_ = minimum;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp38_ = osinfo_resources_get_ram (_tmp37_);
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp39_ = _tmp38_;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp35_ = _tmp39_ > ((gint64) 0);
#line 1952 "os-database.c"
		} else {
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp35_ = FALSE;
#line 1956 "os-database.c"
		}
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp40_ = _tmp35_;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp40_) {
#line 1962 "os-database.c"
			OsinfoResources* _tmp41_ = NULL;
			OsinfoResources* _tmp42_ = NULL;
			gint64 _tmp43_ = 0LL;
			gint64 _tmp44_ = 0LL;
			OsinfoResources* _tmp45_ = NULL;
			gint64 _tmp46_ = 0LL;
			gint64 _tmp47_ = 0LL;
			gint64 _tmp48_ = 0LL;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp41_ = resources;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp42_ = minimum;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp43_ = osinfo_resources_get_ram (_tmp42_);
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp44_ = _tmp43_;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp45_ = resources;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp46_ = osinfo_resources_get_ram (_tmp45_);
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp47_ = _tmp46_;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp48_ = MAX (_tmp44_, _tmp47_);
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_ram (_tmp41_, _tmp48_);
#line 1989 "os-database.c"
		}
	}
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp50_ = recommended;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp50_ != NULL) {
#line 1996 "os-database.c"
		OsinfoResources* _tmp51_ = NULL;
		gint64 _tmp52_ = 0LL;
		gint64 _tmp53_ = 0LL;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp51_ = recommended;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp52_ = osinfo_resources_get_storage (_tmp51_);
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp53_ = _tmp52_;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp49_ = _tmp53_ > ((gint64) 0);
#line 2008 "os-database.c"
	} else {
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp49_ = FALSE;
#line 2012 "os-database.c"
	}
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp54_ = _tmp49_;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp54_) {
#line 2018 "os-database.c"
		OsinfoResources* _tmp55_ = NULL;
		OsinfoResources* _tmp56_ = NULL;
		gint64 _tmp57_ = 0LL;
		gint64 _tmp58_ = 0LL;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp55_ = resources;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp56_ = recommended;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp57_ = osinfo_resources_get_storage (_tmp56_);
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp58_ = _tmp57_;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_storage (_tmp55_, _tmp58_);
#line 2033 "os-database.c"
	} else {
		gboolean _tmp59_ = FALSE;
		OsinfoResources* _tmp60_ = NULL;
		gboolean _tmp64_ = FALSE;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp60_ = minimum;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp60_ != NULL) {
#line 2042 "os-database.c"
			OsinfoResources* _tmp61_ = NULL;
			gint64 _tmp62_ = 0LL;
			gint64 _tmp63_ = 0LL;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp61_ = minimum;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp62_ = osinfo_resources_get_storage (_tmp61_);
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp63_ = _tmp62_;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp59_ = _tmp63_ > ((gint64) 0);
#line 2054 "os-database.c"
		} else {
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp59_ = FALSE;
#line 2058 "os-database.c"
		}
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp64_ = _tmp59_;
#line 147 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp64_) {
#line 2064 "os-database.c"
			OsinfoResources* _tmp65_ = NULL;
			OsinfoResources* _tmp66_ = NULL;
			gint64 _tmp67_ = 0LL;
			gint64 _tmp68_ = 0LL;
			OsinfoResources* _tmp69_ = NULL;
			gint64 _tmp70_ = 0LL;
			gint64 _tmp71_ = 0LL;
			gint64 _tmp72_ = 0LL;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp65_ = resources;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp66_ = minimum;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp67_ = osinfo_resources_get_storage (_tmp66_);
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp68_ = _tmp67_;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp69_ = resources;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp70_ = osinfo_resources_get_storage (_tmp69_);
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp71_ = _tmp70_;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp72_ = MAX (_tmp68_ * 2, _tmp71_);
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_storage (_tmp65_, _tmp72_);
#line 2091 "os-database.c"
		}
	}
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = resources;
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 2098 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_prefered_resources (BoxesOSDatabase* self, 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 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = prefs;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0__length1 = prefs_length1;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp0__length1 <= 0) {
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = NULL;
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 2128 "os-database.c"
	}
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = list;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = prefs;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2__length1 = prefs_length1;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = _tmp2_[0];
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = boxes_os_database_filter_resources_list_by_arch (self, _tmp1_, _tmp3_);
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	filtered = _tmp4_;
#line 158 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = filtered;
#line 158 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = osinfo_list_get_length ((OsinfoList*) _tmp5_);
#line 158 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp6_ <= 0) {
#line 2148 "os-database.c"
		OsinfoResourcesList* _tmp7_ = NULL;
		gchar** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gchar** _tmp9_ = NULL;
		gint _tmp9__length1 = 0;
		OsinfoResources* _tmp10_ = NULL;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp7_ = list;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = prefs;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8__length1 = prefs_length1;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9_ = prefs;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = prefs_length1;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = boxes_os_database_get_prefered_resources (self, _tmp7_, _tmp8_ + 1, _tmp9__length1 - 1);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp10_;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 2173 "os-database.c"
	} else {
		OsinfoResourcesList* _tmp11_ = NULL;
		OsinfoEntity* _tmp12_ = NULL;
		OsinfoResources* _tmp13_ = NULL;
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp11_ = filtered;
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = osinfo_list_get_nth ((OsinfoList*) _tmp11_, 0);
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp12_) : NULL);
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp13_;
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 2190 "os-database.c"
	}
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (filtered);
#line 2194 "os-database.c"
}


static OsinfoResourcesList* boxes_os_database_filter_resources_list_by_arch (BoxesOSDatabase* self, OsinfoResourcesList* list, const gchar* arch) {
	OsinfoResourcesList* result = NULL;
	OsinfoResourcesList* new_list = NULL;
	OsinfoResourcesList* _tmp0_ = NULL;
	OsinfoResourcesList* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (arch != NULL, NULL);
#line 167 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resourceslist_new ();
#line 167 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	new_list = _tmp0_;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = list;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = osinfo_list_get_elements ((OsinfoList*) _tmp1_);
#line 2218 "os-database.c"
	{
		GList* entity_collection = NULL;
		GList* entity_it = NULL;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		entity_collection = _tmp2_;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		for (entity_it = entity_collection; entity_it != NULL; entity_it = entity_it->next) {
#line 2226 "os-database.c"
			OsinfoEntity* entity = NULL;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			entity = (OsinfoEntity*) entity_it->data;
#line 2230 "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;
				gboolean _tmp13_ = FALSE;
#line 169 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp3_ = entity;
#line 169 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp3_) : NULL);
#line 169 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				resources = _tmp4_;
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp5_ = arch;
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp6_ = resources;
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp7_ = osinfo_resources_get_architecture (_tmp6_);
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp8_ = _tmp7_;
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp9_ = boxes_compare_cpu_architectures (_tmp5_, _tmp8_);
#line 170 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				compatibility = _tmp9_;
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp11_ = compatibility;
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				if (_tmp11_ == BOXES_CPU_ARCH_COMPATIBILITY_IDENTICAL) {
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp10_ = TRUE;
#line 2268 "os-database.c"
				} else {
					BoxesCPUArchCompatibility _tmp12_ = 0;
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp12_ = compatibility;
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp10_ = _tmp12_ == BOXES_CPU_ARCH_COMPATIBILITY_COMPATIBLE;
#line 2275 "os-database.c"
				}
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp13_ = _tmp10_;
#line 171 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				if (_tmp13_) {
#line 2281 "os-database.c"
					OsinfoResourcesList* _tmp14_ = NULL;
					OsinfoResources* _tmp15_ = NULL;
#line 172 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp14_ = new_list;
#line 172 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp15_ = resources;
#line 172 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					osinfo_list_add ((OsinfoList*) _tmp14_, (OsinfoEntity*) _tmp15_);
#line 2290 "os-database.c"
				}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (resources);
#line 2294 "os-database.c"
			}
		}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_list_free0 (entity_collection);
#line 2299 "os-database.c"
	}
#line 175 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = new_list;
#line 175 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 2305 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseEnsureDbLoadedData, _data_);
#line 2316 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	BoxesOSDatabase* _tmp0_ = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseEnsureDbLoadedData);
#line 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/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 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data_);
#line 2335 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	gboolean result;
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 2348 "os-database.c"
}


static Block48Data* block48_data_ref (Block48Data* _data48_) {
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data48_->_ref_count_);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data48_;
#line 2357 "os-database.c"
}


static void block48_data_unref (void * _userdata_) {
	Block48Data* _data48_;
	_data48_ = (Block48Data*) _userdata_;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data48_->_ref_count_)) {
#line 2366 "os-database.c"
		BoxesOSDatabase * self;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data48_->self;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block48Data, _data48_);
#line 2374 "os-database.c"
	}
}


static Block49Data* block49_data_ref (Block49Data* _data49_) {
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data49_->_ref_count_);
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data49_;
#line 2384 "os-database.c"
}


static void block49_data_unref (void * _userdata_) {
	Block49Data* _data49_;
	_data49_ = (Block49Data*) _userdata_;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data49_->_ref_count_)) {
#line 2393 "os-database.c"
		BoxesOSDatabase * self;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data49_->_data48_->self;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block48_data_unref (_data49_->_data48_);
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data49_->_data48_ = NULL;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block49Data, _data49_);
#line 2403 "os-database.c"
	}
}


static void ___lambda40_ (Block49Data* _data49_) {
	Block48Data* _data48_;
	BoxesOSDatabase * self;
	gulong _tmp0_ = 0UL;
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data48_ = _data49_->_data48_;
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data48_->self;
#line 186 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data48_->_async_data_);
#line 187 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _data49_->db_loaded_id;
#line 187 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_signal_handler_disconnect ((GObject*) self, _tmp0_);
#line 2422 "os-database.c"
}


static void ____lambda40__boxes_os_database_db_loaded (BoxesOSDatabase* _sender, gpointer self) {
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda40_ (self);
#line 2429 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_) {
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 2438 "os-database.c"
		goto _state_0;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 2442 "os-database.c"
		goto _state_1;
		default:
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 2447 "os-database.c"
	}
	_state_0:
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_ = g_slice_new0 (Block48Data);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_->_ref_count_ = 1;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_->self = g_object_ref (_data_->self);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_->_async_data_ = _data_;
#line 179 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = NULL;
#line 179 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = _data_->self->priv->db;
#line 179 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp0_ != NULL) {
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = TRUE;
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block48_data_unref (_data_->_data48_);
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data48_ = NULL;
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2474 "os-database.c"
		} else {
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 2478 "os-database.c"
		}
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 180 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 2484 "os-database.c"
	}
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = FALSE;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db_loading;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp1_) {
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_ = g_slice_new0 (Block49Data);
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_->_ref_count_ = 1;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_->_data48_ = block48_data_ref (_data_->_data48_);
#line 183 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_->db_loaded_id = (gulong) 0;
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = 0UL;
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_signal_connect_data (_data_->self, "db-loaded", (GCallback) ____lambda40__boxes_os_database_db_loaded, block49_data_ref (_data_->_data49_), (GClosureNotify) block49_data_unref, 0);
#line 185 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_->db_loaded_id = _data_->_tmp2_;
#line 190 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 190 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 2510 "os-database.c"
		_state_1:
		;
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block49_data_unref (_data_->_data49_);
#line 182 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data49_ = NULL;
#line 2517 "os-database.c"
	}
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp3_ != NULL;
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block48_data_unref (_data_->_data48_);
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_ = NULL;
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2533 "os-database.c"
	} else {
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2537 "os-database.c"
	}
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 193 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block48_data_unref (_data_->_data48_);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data48_ = NULL;
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2551 "os-database.c"
	} else {
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2555 "os-database.c"
	}
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 178 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 2561 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_construct (GType object_type) {
	BoxesOSDatabase * self = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = (BoxesOSDatabase*) g_object_new (object_type, NULL);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return self;
#line 2571 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_new (void) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return boxes_os_database_construct (BOXES_TYPE_OS_DATABASE);
#line 2578 "os-database.c"
}


static void boxes_os_database_class_init (BoxesOSDatabaseClass * klass) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_parent_class = g_type_class_peek_parent (klass);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_type_class_add_private (klass, sizeof (BoxesOSDatabasePrivate));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_os_database_finalize;
#line 11 "/extra-data/checkout/gnome/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 2591 "os-database.c"
}


static void boxes_os_database_instance_init (BoxesOSDatabase * self) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self->priv = BOXES_OS_DATABASE_GET_PRIVATE (self);
#line 2598 "os-database.c"
}


static void boxes_os_database_finalize (GObject* obj) {
	BoxesOSDatabase * self;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OS_DATABASE, BoxesOSDatabase);
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (self->priv->db);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (boxes_os_database_parent_class)->finalize (obj);
#line 2610 "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 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 2629 "os-database.c"
		int i;
#line 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
				destroy_func (((gpointer*) array)[i]);
#line 2637 "os-database.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 471 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	g_free (array);
#line 2649 "os-database.c"
}



