/* os-database.c generated by valac 0.39.5, 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 <gtk/gtk.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;
enum  {
	BOXES_OS_DATABASE_0_PROPERTY,
	BOXES_OS_DATABASE_NUM_PROPERTIES
};
static GParamSpec* boxes_os_database_properties[BOXES_OS_DATABASE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block69Data Block69Data;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesOsDatabaseLoadData BoxesOsDatabaseLoadData;
typedef struct _BoxesOsDatabaseGuessOsFromInstallMediaPathData BoxesOsDatabaseGuessOsFromInstallMediaPathData;
typedef struct _BoxesOsDatabaseGuessOsFromInstallMediaData BoxesOsDatabaseGuessOsFromInstallMediaData;
typedef struct _BoxesOsDatabaseGetOsByIdData BoxesOsDatabaseGetOsByIdData;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _BoxesOsDatabaseListOsByDistroData BoxesOsDatabaseListOsByDistroData;
typedef struct _BoxesOsDatabaseGetAllMediaUrlsAsStoreData BoxesOsDatabaseGetAllMediaUrlsAsStoreData;

#define BOXES_TYPE_CPU_ARCH_COMPATIBILITY (boxes_cpu_arch_compatibility_get_type ())
typedef struct _Block70Data Block70Data;
typedef struct _Block71Data Block71Data;
typedef struct _BoxesOsDatabaseEnsureDbLoadedData BoxesOsDatabaseEnsureDbLoadedData;
enum  {
	BOXES_OS_DATABASE_DB_LOADED_SIGNAL,
	BOXES_OS_DATABASE_NUM_SIGNALS
};
static guint boxes_os_database_signals[BOXES_OS_DATABASE_NUM_SIGNALS] = {0};

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

struct _BoxesOSDatabaseClass {
	GObjectClass parent_class;
};

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

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

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _BoxesOsDatabaseLoadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	Block69Data* _data69_;
	OsinfoLoader* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesAsyncLauncher* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	BoxesApp* _tmp5_;
	BoxesAsyncLauncher* _tmp6_;
	GError* _vala1_e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	OsinfoDb* _tmp9_;
	OsinfoDb* _tmp10_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGuessOsFromInstallMediaPathData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	gchar* media_path;
	GCancellable* cancellable;
	OsinfoMedia* result;
	OsinfoMedia* media;
	OsinfoMedia* _tmp0_;
	OsinfoMedia* _tmp1_;
	OsinfoMedia* _tmp2_;
	OsinfoMedia* _tmp3_;
	OsinfoMedia* _tmp4_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGuessOsFromInstallMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	OsinfoMedia* media;
	OsinfoMedia* result;
	OsinfoDb* _tmp0_;
	OsinfoMedia* _tmp1_;
};

struct _BoxesOsDatabaseGetOsByIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	gchar* id;
	OsinfoOs* result;
	GError* _tmp0_;
	OsinfoOs* os;
	OsinfoDb* _tmp1_;
	OsinfoOs* _tmp2_;
	OsinfoOs* _tmp3_;
	OsinfoOs* _tmp4_;
	GError* _tmp5_;
	GError * _inner_error_;
};

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

struct _BoxesOsDatabaseGetAllMediaUrlsAsStoreData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	GtkListStore* result;
	GError* _tmp0_;
	GtkListStore* store;
	GtkListStore* _tmp1_;
	OsinfoDb* _tmp2_;
	OsinfoOsList* _tmp3_;
	OsinfoOsList* _tmp4_;
	GList* _tmp5_;
	GList* _tmp6_;
	GList* entity_collection;
	GList* entity_it;
	OsinfoEntity* entity;
	OsinfoOs* os;
	OsinfoEntity* _tmp7_;
	OsinfoOs* _tmp8_;
	OsinfoOs* _tmp9_;
	OsinfoMediaList* _tmp10_;
	OsinfoMediaList* _tmp11_;
	GList* _tmp12_;
	GList* _tmp13_;
	GList* media_entity_collection;
	GList* media_entity_it;
	OsinfoEntity* media_entity;
	OsinfoMedia* media;
	OsinfoEntity* _tmp14_;
	OsinfoMedia* _tmp15_;
	gboolean _tmp16_;
	OsinfoMedia* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	OsinfoMedia* _tmp23_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	OsinfoMedia* _tmp26_;
	gboolean _tmp27_;
	gboolean _tmp28_;
	GtkTreeIter iter;
	GtkListStore* _tmp29_;
	GtkTreeIter _tmp30_;
	GtkListStore* _tmp31_;
	GtkTreeIter _tmp32_;
	OsinfoMedia* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	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 _Block70Data {
	int _ref_count_;
	BoxesOSDatabase* self;
	gpointer _async_data_;
};

struct _Block71Data {
	int _ref_count_;
	Block70Data * _data70_;
	gulong db_loaded_id;
};

struct _BoxesOsDatabaseEnsureDbLoadedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOSDatabase* self;
	gboolean result;
	Block70Data* _data70_;
	OsinfoDb* _tmp0_;
	gboolean _tmp1_;
	Block71Data* _data71_;
	gulong _tmp2_;
	OsinfoDb* _tmp3_;
};


static gpointer boxes_os_database_parent_class = NULL;
extern BoxesApp* boxes_app_app;

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))
#define BOXES_OS_DATABASE_DEFAULT_VCPUS 1
#define BOXES_OS_DATABASE_DEFAULT_RAM (2 * ((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);
static void boxes_os_database_load_async_ready_wrapper (GObject *source_object,
                                                 GAsyncResult *res,
                                                 void *user_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 Block69Data* block69_data_ref (Block69Data* _data69_);
static void block69_data_unref (void * _userdata_);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
static void ___lambda15_ (Block69Data* _data69_,
                   GError** error);
static void ____lambda15__boxes_async_launcher_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 ___lambda16_ (Block69Data* _data69_,
                   GError** error);
static void ____lambda16__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                            GError** error);
static void boxes_os_database_guess_os_from_install_media_path_data_free (gpointer _data);
static void boxes_os_database_guess_os_from_install_media_path_async_ready_wrapper (GObject *source_object,
                                                                             GAsyncResult *res,
                                                                             void *user_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 void boxes_os_database_guess_os_from_install_media_async_ready_wrapper (GObject *source_object,
                                                                        GAsyncResult *res,
                                                                        void *user_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);
static void boxes_os_database_get_os_by_id_async_ready_wrapper (GObject *source_object,
                                                         GAsyncResult *res,
                                                         void *user_data);
void boxes_os_database_get_os_by_id (BoxesOSDatabase* self,
                                     const gchar* id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_);
static void boxes_os_database_get_os_by_id_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void boxes_os_database_list_os_by_distro_data_free (gpointer _data);
static void boxes_os_database_list_os_by_distro_async_ready_wrapper (GObject *source_object,
                                                              GAsyncResult *res,
                                                              void *user_data);
static GDate* _g_date_dup (GDate* self);
void boxes_os_database_list_os_by_distro (BoxesOSDatabase* self,
                                          const gchar* distro,
                                          GDate* after,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
GList* boxes_os_database_list_os_by_distro_finish (BoxesOSDatabase* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean boxes_os_database_list_os_by_distro_co (BoxesOsDatabaseListOsByDistroData* _data_);
static void boxes_os_database_list_os_by_distro_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static gint __lambda18_ (OsinfoOs* os_a,
                  OsinfoOs* os_b);
static gint ___lambda18__gcompare_func (gconstpointer a,
                                 gconstpointer b);
static void boxes_os_database_get_all_media_urls_as_store_data_free (gpointer _data);
static void boxes_os_database_get_all_media_urls_as_store_async_ready_wrapper (GObject *source_object,
                                                                        GAsyncResult *res,
                                                                        void *user_data);
void boxes_os_database_get_all_media_urls_as_store (BoxesOSDatabase* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
GtkListStore* boxes_os_database_get_all_media_urls_as_store_finish (BoxesOSDatabase* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static gboolean boxes_os_database_get_all_media_urls_as_store_co (BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_);
static void boxes_os_database_get_all_media_urls_as_store_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_add7 (gchar** * array,
                       int* length,
                       int* size,
                       gchar* value);
static void _vala_array_add8 (gchar** * array,
                       int* length,
                       int* size,
                       gchar* value);
static gchar** _vala_array_dup3 (gchar** self,
                          int length);
static OsinfoResources* boxes_os_database_get_prefered_resources (OsinfoResourcesList* list,
                                                           gchar** prefs,
                                                           int prefs_length1);
static OsinfoResources* boxes_os_database_get_resources_from_os_resources (BoxesOSDatabase* self,
                                                                    OsinfoResources* minimum,
                                                                    OsinfoResources* recommended);
OsinfoResources* boxes_os_database_get_recommended_resources_for_os (OsinfoOs* os,
                                                                     const gchar* architecture);
OsinfoResources* boxes_os_database_get_minimum_resources_for_os (OsinfoOs* os,
                                                                 const gchar* architecture);
static OsinfoResourcesList* boxes_os_database_filter_resources_list_by_arch (OsinfoResourcesList* list,
                                                                      const gchar* arch);
GType boxes_cpu_arch_compatibility_get_type (void) G_GNUC_CONST;
BoxesCPUArchCompatibility boxes_compare_cpu_architectures (const gchar* arch1,
                                                           const gchar* arch2);
static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data);
static void boxes_os_database_ensure_db_loaded_async_ready_wrapper (GObject *source_object,
                                                             GAsyncResult *res,
                                                             void *user_data);
static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_);
static Block70Data* block70_data_ref (Block70Data* _data70_);
static void block70_data_unref (void * _userdata_);
static Block71Data* block71_data_ref (Block71Data* _data71_);
static void block71_data_unref (void * _userdata_);
static void ___lambda17_ (Block71Data* _data71_);
static void ____lambda17__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 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	return g_quark_from_static_string ("boxes_os_database_error-quark");
#line 522 "os-database.c"
}


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


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


static void
boxes_os_database_load_async_ready_wrapper (GObject *source_object,
                                            GAsyncResult *res,
                                            void *user_data)
{
	BoxesOsDatabaseLoadData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 575 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 579 "os-database.c"
}


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


void
boxes_os_database_load (BoxesOSDatabase* self,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	BoxesOsDatabaseLoadData* _data_;
	BoxesOSDatabase* _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseLoadData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_load_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 609 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_load_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 619 "os-database.c"
}


void
boxes_os_database_load_finish (BoxesOSDatabase* self,
                               GAsyncResult* _res_)
{
	BoxesOsDatabaseLoadData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 630 "os-database.c"
}


static Block69Data*
block69_data_ref (Block69Data* _data69_)
{
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data69_->_ref_count_);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return _data69_;
#line 641 "os-database.c"
}


static void
block69_data_unref (void * _userdata_)
{
	Block69Data* _data69_;
	_data69_ = (Block69Data*) _userdata_;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data69_->_ref_count_)) {
#line 652 "os-database.c"
		BoxesOSDatabase* self;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		self = _data69_->self;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data69_->loader);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_slice_free (Block69Data, _data69_);
#line 662 "os-database.c"
	}
}


static void
___lambda15_ (Block69Data* _data69_,
              GError** error)
{
	BoxesOSDatabase* self;
	GError * _inner_error_ = NULL;
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	self = _data69_->self;
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_default_path (_data69_->loader, &_inner_error_);
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return;
#line 683 "os-database.c"
	}
}


static void
____lambda15__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                       GError** error)
{
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	___lambda15_ (self, error);
#line 694 "os-database.c"
}


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


static void
___lambda16_ (Block69Data* _data69_,
              GError** error)
{
	BoxesOSDatabase* self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	self = _data69_->self;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_get_custom_osinfo_db ();
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = _tmp0_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_path (_data69_->loader, _tmp1_, &_inner_error_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (_tmp1_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return;
#line 742 "os-database.c"
	}
}


static void
____lambda16__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                       GError** error)
{
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	___lambda16_ (self, error);
#line 753 "os-database.c"
}


static gboolean
boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_)
{
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 764 "os-database.c"
		goto _state_0;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 768 "os-database.c"
		goto _state_1;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 2:
#line 772 "os-database.c"
		goto _state_2;
		default:
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 777 "os-database.c"
	}
	_state_0:
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_ = g_slice_new0 (Block69Data);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_->_ref_count_ = 1;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_->self = g_object_ref (_data_->self);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_->_async_data_ = _data_;
#line 37 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = TRUE;
#line 38 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = osinfo_loader_new ();
#line 38 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_->loader = _data_->_tmp0_;
#line 794 "os-database.c"
	{
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = boxes_app_app;
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = _data_->_tmp1_->async_launcher;
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		boxes_async_launcher_launch (_data_->_tmp2_, ____lambda15__boxes_async_launcher_run_in_thread_func, block69_data_ref (_data_->_data69_), block69_data_unref, boxes_os_database_load_ready, _data_);
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 806 "os-database.c"
		_state_1:
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		boxes_async_launcher_launch_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
#line 40 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 812 "os-database.c"
			goto __catch70_g_error;
		}
	}
	goto __finally70;
	__catch70_g_error:
	{
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->e = _data_->_inner_error_;
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 42 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = _data_->e;
#line 42 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 42 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:42: Error loading default libosinfo database: %s", _data_->_tmp4_);
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->e);
#line 831 "os-database.c"
	}
	__finally70:
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		block69_data_unref (_data_->_data69_);
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data69_ = NULL;
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 39 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 848 "os-database.c"
	}
	{
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = boxes_app_app;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp6_ = _data_->_tmp5_->async_launcher;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 2;
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		boxes_async_launcher_launch (_data_->_tmp6_, ____lambda16__boxes_async_launcher_run_in_thread_func, block69_data_ref (_data_->_data69_), block69_data_unref, boxes_os_database_load_ready, _data_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 861 "os-database.c"
		_state_2:
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		boxes_async_launcher_launch_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 867 "os-database.c"
			goto __catch71_g_error;
		}
	}
	goto __finally71;
	__catch71_g_error:
	{
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_vala1_e = _data_->_inner_error_;
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 47 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp7_ = _data_->_vala1_e;
#line 47 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = _data_->_tmp7_->message;
#line 47 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:47: Error loading GNOME Boxes libosinfo database: %s", _data_->_tmp8_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->_vala1_e);
#line 886 "os-database.c"
	}
	__finally71:
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		block69_data_unref (_data_->_data69_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data69_ = NULL;
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 44 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 903 "os-database.c"
	}
#line 49 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp9_ = osinfo_loader_get_db (_data_->_data69_->loader);
#line 49 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp10_ = _g_object_ref0 (_data_->_tmp9_);
#line 49 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self->priv->db);
#line 49 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db = _data_->_tmp10_;
#line 50 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = FALSE;
#line 51 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_signal_emit (_data_->self, boxes_os_database_signals[BOXES_OS_DATABASE_DB_LOADED_SIGNAL], 0);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	block69_data_unref (_data_->_data69_);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data69_ = NULL;
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 929 "os-database.c"
		}
	}
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 36 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 936 "os-database.c"
}


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


static void
boxes_os_database_guess_os_from_install_media_path_async_ready_wrapper (GObject *source_object,
                                                                        GAsyncResult *res,
                                                                        void *user_data)
{
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 971 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 975 "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_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaPathData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, boxes_os_database_guess_os_from_install_media_path_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 1000 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_guess_os_from_install_media_path_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (media_path);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->media_path = _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = _g_object_ref0 (cancellable);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->cancellable = _tmp2_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_path_co (_data_);
#line 1022 "os-database.c"
}


OsinfoMedia*
boxes_os_database_guess_os_from_install_media_path_finish (BoxesOSDatabase* self,
                                                           GAsyncResult* _res_,
                                                           GError** error)
{
	OsinfoMedia* result;
	BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (NULL == _data_) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1039 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 1047 "os-database.c"
}


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


static gboolean
boxes_os_database_guess_os_from_install_media_path_co (BoxesOsDatabaseGuessOsFromInstallMediaPathData* _data_)
{
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 1078 "os-database.c"
		goto _state_0;
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 1082 "os-database.c"
		goto _state_1;
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 2:
#line 1086 "os-database.c"
		goto _state_2;
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 3:
#line 1090 "os-database.c"
		goto _state_3;
		default:
#line 54 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1095 "os-database.c"
	}
	_state_0:
#line 56 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 56 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1104 "os-database.c"
	_state_1:
#line 56 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (!boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_)) {
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ != 0) {
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1118 "os-database.c"
			}
		}
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 57 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1125 "os-database.c"
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 2;
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	osinfo_media_create_from_location_async (_data_->media_path, G_PRIORITY_DEFAULT, _data_->cancellable, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1133 "os-database.c"
	_state_2:
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = osinfo_media_create_from_location_finish (_data_->_res_, &_data_->_inner_error_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->media = _data_->_tmp0_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 59 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1147 "os-database.c"
	}
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->media;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 3;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media (_data_->self, _data_->_tmp2_, boxes_os_database_guess_os_from_install_media_path_ready, _data_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1157 "os-database.c"
	_state_3:
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = boxes_os_database_guess_os_from_install_media_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->_tmp3_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->media);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1173 "os-database.c"
	}
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->_tmp1_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = NULL;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp4_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->_tmp1_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1193 "os-database.c"
		}
	}
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 61 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1200 "os-database.c"
}


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


static void
boxes_os_database_guess_os_from_install_media_async_ready_wrapper (GObject *source_object,
                                                                   GAsyncResult *res,
                                                                   void *user_data)
{
	BoxesOsDatabaseGuessOsFromInstallMediaData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1233 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1237 "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_;
	OsinfoMedia* _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_guess_os_from_install_media_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 1260 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_guess_os_from_install_media_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = _g_object_ref0 (media);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->media = _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 1276 "os-database.c"
}


OsinfoMedia*
boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	OsinfoMedia* result;
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (NULL == _data_) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1293 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 1301 "os-database.c"
}


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


static gboolean
boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_)
{
#line 64 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 64 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 1332 "os-database.c"
		goto _state_0;
#line 64 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 1336 "os-database.c"
		goto _state_1;
		default:
#line 64 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1341 "os-database.c"
	}
	_state_0:
#line 65 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 65 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_guess_os_from_install_media_ready, _data_);
#line 65 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1350 "os-database.c"
	_state_1:
#line 65 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (!boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_)) {
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ != 0) {
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1364 "os-database.c"
			}
		}
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 66 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1371 "os-database.c"
	}
#line 68 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = _data_->self->priv->db;
#line 68 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (osinfo_db_identify_media (_data_->_tmp0_, _data_->media)) {
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _g_object_ref0 (_data_->media);
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->result = _data_->_tmp1_;
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ != 0) {
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1389 "os-database.c"
			}
		}
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 69 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 1396 "os-database.c"
	}
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1408 "os-database.c"
		}
	}
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 71 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1415 "os-database.c"
}


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


static void
boxes_os_database_get_os_by_id_async_ready_wrapper (GObject *source_object,
                                                    GAsyncResult *res,
                                                    void *user_data)
{
	BoxesOsDatabaseGetOsByIdData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1448 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1452 "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_;
	gchar* _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGetOsByIdData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_get_os_by_id_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 1475 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_get_os_by_id_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (id);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->id = _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 1491 "os-database.c"
}


OsinfoOs*
boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	OsinfoOs* result;
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (NULL == _data_) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1508 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 1516 "os-database.c"
}


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


static gboolean
boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_)
{
#line 74 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 74 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 1547 "os-database.c"
		goto _state_0;
#line 74 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 1551 "os-database.c"
		goto _state_1;
		default:
#line 74 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1556 "os-database.c"
	}
	_state_0:
#line 75 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 75 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_get_os_by_id_ready, _data_);
#line 75 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1565 "os-database.c"
	_state_1:
#line 75 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (!boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_)) {
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp0_ = g_error_new_literal (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED, "Failed to load OS database");
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp0_;
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1581 "os-database.c"
		} else {
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 76 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1591 "os-database.c"
		}
	}
#line 78 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db;
#line 78 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = osinfo_db_get_os (_data_->_tmp1_, _data_->id);
#line 78 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
#line 78 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->os = _data_->_tmp3_;
#line 79 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->os;
#line 79 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp4_ == NULL) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp5_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->id);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp5_;
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1620 "os-database.c"
		} else {
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 80 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1632 "os-database.c"
		}
	}
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->os;
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1645 "os-database.c"
		}
	}
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 82 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1652 "os-database.c"
}


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


static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 1670 "os-database.c"
}


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


static void
boxes_os_database_list_os_by_distro_async_ready_wrapper (GObject *source_object,
                                                         GAsyncResult *res,
                                                         void *user_data)
{
	BoxesOsDatabaseListOsByDistroData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1705 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1709 "os-database.c"
}


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


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


void
boxes_os_database_list_os_by_distro (BoxesOSDatabase* self,
                                     const gchar* distro,
                                     GDate* after,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	BoxesOsDatabaseListOsByDistroData* _data_;
	BoxesOSDatabase* _tmp0_;
	gchar* _tmp1_;
	GDate* _tmp2_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseListOsByDistroData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_list_os_by_distro_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 1757 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_list_os_by_distro_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (distro);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->distro);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->distro = _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = __g_date_dup0 (after);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->after);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->after = _tmp2_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_list_os_by_distro_co (_data_);
#line 1779 "os-database.c"
}


GList*
boxes_os_database_list_os_by_distro_finish (BoxesOSDatabase* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	GList* result;
	BoxesOsDatabaseListOsByDistroData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (NULL == _data_) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return NULL;
#line 1796 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 1804 "os-database.c"
}


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


static gint
__lambda18_ (OsinfoOs* os_a,
             OsinfoOs* os_b)
{
	gint result = 0;
	GDate* release_a = NULL;
	GDate* _tmp0_;
	GDate* release_b = NULL;
	GDate* _tmp1_;
	GDate* _tmp2_;
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os_a != NULL, 0);
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os_b != NULL, 0);
#line 115 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (osinfo_os_get_release_status (os_a) != OSINFO_RELEASE_STATUS_RELEASED) {
#line 116 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = 1;
#line 116 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 1848 "os-database.c"
	} else {
#line 117 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (osinfo_os_get_release_status (os_b) != OSINFO_RELEASE_STATUS_RELEASED) {
#line 118 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			result = -1;
#line 118 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return result;
#line 1856 "os-database.c"
		}
	}
#line 120 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_product_get_release_date ((OsinfoProduct*) os_a);
#line 120 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	release_a = _tmp0_;
#line 121 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_product_get_release_date ((OsinfoProduct*) os_b);
#line 121 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	release_b = _tmp1_;
#line 123 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = release_a;
#line 123 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_tmp2_ == NULL) {
#line 124 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = 1;
#line 124 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_free0 (release_b);
#line 124 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_free0 (release_a);
#line 124 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 1879 "os-database.c"
	} else {
		GDate* _tmp3_;
#line 125 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp3_ = release_b;
#line 125 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_tmp3_ == NULL) {
#line 126 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			result = -1;
#line 126 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_free0 (release_b);
#line 126 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_free0 (release_a);
#line 126 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return result;
#line 1894 "os-database.c"
		} else {
			GDate* _tmp4_;
			GDate* _tmp5_;
			GDate _tmp6_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp4_ = release_a;
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp5_ = release_b;
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp6_ = *_tmp5_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			result = g_date_compare (_tmp4_, &_tmp6_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_free0 (release_b);
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_free0 (release_a);
#line 128 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return result;
#line 1913 "os-database.c"
		}
	}
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (release_b);
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_free0 (release_a);
#line 1920 "os-database.c"
}


static gint
___lambda18__gcompare_func (gconstpointer a,
                            gconstpointer b)
{
	gint result;
	result = __lambda18_ ((OsinfoOs*) a, (OsinfoOs*) b);
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 1932 "os-database.c"
}


static gboolean
boxes_os_database_list_os_by_distro_co (BoxesOsDatabaseListOsByDistroData* _data_)
{
#line 91 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 91 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 1943 "os-database.c"
		goto _state_0;
#line 91 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 1947 "os-database.c"
		goto _state_1;
		default:
#line 91 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 1952 "os-database.c"
	}
	_state_0:
#line 92 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 92 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_list_os_by_distro_ready, _data_);
#line 92 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1961 "os-database.c"
	_state_1:
#line 92 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (!boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_)) {
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp0_ = g_error_new_literal (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED, "Failed to load OS database");
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp0_;
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1977 "os-database.c"
		} else {
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 93 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1987 "os-database.c"
		}
	}
#line 95 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db;
#line 95 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = osinfo_db_get_os_list (_data_->_tmp1_);
#line 95 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->os_list = _data_->_tmp2_;
#line 96 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_filter_new ();
#line 96 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->filter = _data_->_tmp3_;
#line 97 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->filter;
#line 97 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	osinfo_filter_add_constraint (_data_->_tmp4_, OSINFO_OS_PROP_DISTRO, _data_->distro);
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _data_->os_list;
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _data_->filter;
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = osinfo_list_new_filtered (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp5_, osinfo_list_get_type ()) ? ((OsinfoList*) _data_->_tmp5_) : NULL, _data_->_tmp6_);
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp8_ = G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp7_, osinfo_oslist_get_type ()) ? ((OsinfoOsList*) _data_->_tmp7_) : NULL;
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp8_ == NULL) {
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->_tmp7_);
#line 2016 "os-database.c"
	}
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_list);
#line 98 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->os_list = _data_->_tmp8_;
#line 100 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->after_list = NULL;
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp9_ = _data_->os_list;
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp10_ = osinfo_list_get_elements ((OsinfoList*) _data_->_tmp9_);
#line 2028 "os-database.c"
	{
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->entity_collection = _data_->_tmp10_;
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		for (_data_->entity_it = _data_->entity_collection; _data_->entity_it != NULL; _data_->entity_it = _data_->entity_it->next) {
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_data_->entity = (OsinfoEntity*) _data_->entity_it->data;
#line 2036 "os-database.c"
			{
#line 102 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp11_ = _data_->entity;
#line 102 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp11_, osinfo_os_get_type ()) ? ((OsinfoOs*) _data_->_tmp11_) : NULL);
#line 102 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->os = _data_->_tmp12_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				if (_data_->after != NULL) {
#line 105 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp13_ = _data_->os;
#line 105 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp14_ = osinfo_product_get_release_date ((OsinfoProduct*) _data_->_tmp13_);
#line 105 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->release_date = _data_->_tmp14_;
#line 106 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp15_ = _data_->os;
#line 106 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->status = osinfo_os_get_release_status (_data_->_tmp15_);
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp17_ = _data_->status;
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					if (_data_->_tmp17_ != OSINFO_RELEASE_STATUS_RELEASED) {
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->_tmp16_ = TRUE;
#line 2062 "os-database.c"
					} else {
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->_tmp19_ = _data_->release_date;
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						if (_data_->_tmp19_ != NULL) {
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp20_ = _data_->release_date;
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp21_ = *_data_->after;
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp18_ = g_date_compare (_data_->_tmp20_, &_data_->_tmp21_) > 0;
#line 2074 "os-database.c"
						} else {
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp18_ = FALSE;
#line 2078 "os-database.c"
						}
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->_tmp16_ = _data_->_tmp18_;
#line 2082 "os-database.c"
					}
#line 108 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					if (_data_->_tmp16_) {
#line 109 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->_tmp22_ = _data_->os;
#line 109 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->_tmp23_ = _g_object_ref0 (_data_->_tmp22_);
#line 109 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->after_list = g_list_append (_data_->after_list, _data_->_tmp23_);
#line 2092 "os-database.c"
					}
#line 104 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_g_free0 (_data_->release_date);
#line 2096 "os-database.c"
				} else {
#line 111 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp24_ = _data_->os;
#line 111 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->_tmp25_ = _g_object_ref0 (_data_->_tmp24_);
#line 111 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->after_list = g_list_append (_data_->after_list, _data_->_tmp25_);
#line 2104 "os-database.c"
				}
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (_data_->os);
#line 2108 "os-database.c"
			}
		}
#line 101 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_list_free0 (_data_->entity_collection);
#line 2113 "os-database.c"
	}
#line 114 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->after_list = g_list_sort (_data_->after_list, ___lambda18__gcompare_func);
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->after_list;
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->filter);
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_list);
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 2131 "os-database.c"
		}
	}
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 131 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 2138 "os-database.c"
}


static void
boxes_os_database_get_all_media_urls_as_store_data_free (gpointer _data)
{
	BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_;
	_data_ = _data;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGetAllMediaUrlsAsStoreData, _data_);
#line 2153 "os-database.c"
}


static void
boxes_os_database_get_all_media_urls_as_store_async_ready_wrapper (GObject *source_object,
                                                                   GAsyncResult *res,
                                                                   void *user_data)
{
	BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 2169 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 2173 "os-database.c"
}


void
boxes_os_database_get_all_media_urls_as_store (BoxesOSDatabase* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_;
	BoxesOSDatabase* _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGetAllMediaUrlsAsStoreData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_get_all_media_urls_as_store_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 2194 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_get_all_media_urls_as_store_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_all_media_urls_as_store_co (_data_);
#line 2204 "os-database.c"
}


GtkListStore*
boxes_os_database_get_all_media_urls_as_store_finish (BoxesOSDatabase* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	GtkListStore* result;
	BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (NULL == _data_) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return NULL;
#line 2221 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2229 "os-database.c"
}


static void
boxes_os_database_get_all_media_urls_as_store_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_task_complete_ = TRUE;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_all_media_urls_as_store_co (_data_);
#line 2249 "os-database.c"
}


static gboolean
boxes_os_database_get_all_media_urls_as_store_co (BoxesOsDatabaseGetAllMediaUrlsAsStoreData* _data_)
{
#line 134 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 134 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 2260 "os-database.c"
		goto _state_0;
#line 134 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 2264 "os-database.c"
		goto _state_1;
		default:
#line 134 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 2269 "os-database.c"
	}
	_state_0:
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_get_all_media_urls_as_store_ready, _data_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 2278 "os-database.c"
	_state_1:
#line 135 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (!boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_)) {
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp0_ = g_error_new_literal (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED, "Failed to load OS database");
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp0_;
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 2294 "os-database.c"
		} else {
#line 136 "/home/fborges/checkout/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 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 136 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 2304 "os-database.c"
		}
	}
#line 138 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = gtk_list_store_new (1, G_TYPE_STRING, -1);
#line 138 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->store = _data_->_tmp1_;
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->self->priv->db;
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_db_get_os_list (_data_->_tmp2_);
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->_tmp3_;
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_list_get_elements ((OsinfoList*) _data_->_tmp4_);
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _data_->_tmp5_;
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->_tmp4_);
#line 2323 "os-database.c"
	{
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->entity_collection = _data_->_tmp6_;
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		for (_data_->entity_it = _data_->entity_collection; _data_->entity_it != NULL; _data_->entity_it = _data_->entity_it->next) {
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_data_->entity = (OsinfoEntity*) _data_->entity_it->data;
#line 2331 "os-database.c"
			{
#line 140 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp7_ = _data_->entity;
#line 140 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp7_, osinfo_os_get_type ()) ? ((OsinfoOs*) _data_->_tmp7_) : NULL);
#line 140 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->os = _data_->_tmp8_;
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp9_ = _data_->os;
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp10_ = osinfo_os_get_media_list (_data_->_tmp9_);
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp11_ = _data_->_tmp10_;
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp12_ = osinfo_list_get_elements ((OsinfoList*) _data_->_tmp11_);
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_data_->_tmp13_ = _data_->_tmp12_;
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (_data_->_tmp11_);
#line 2351 "os-database.c"
				{
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_data_->media_entity_collection = _data_->_tmp13_;
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					for (_data_->media_entity_it = _data_->media_entity_collection; _data_->media_entity_it != NULL; _data_->media_entity_it = _data_->media_entity_it->next) {
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_data_->media_entity = (OsinfoEntity*) _data_->media_entity_it->data;
#line 2359 "os-database.c"
						{
#line 143 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp14_ = _data_->media_entity;
#line 143 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp14_, osinfo_media_get_type ()) ? ((OsinfoMedia*) _data_->_tmp14_) : NULL);
#line 143 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->media = _data_->_tmp15_;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp17_ = _data_->media;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							g_object_get (_data_->_tmp17_, "url", &_data_->_tmp18_, NULL);
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp19_ = _data_->_tmp18_;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp20_ = _data_->_tmp19_;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_data_->_tmp21_ = _data_->_tmp20_ != NULL;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_g_free0 (_data_->_tmp20_);
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							if (_data_->_tmp21_) {
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp23_ = _data_->media;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								g_object_get (_data_->_tmp23_, "installer", &_data_->_tmp24_, NULL);
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp25_ = _data_->_tmp24_;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								if (_data_->_tmp25_) {
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
									_data_->_tmp22_ = TRUE;
#line 2391 "os-database.c"
								} else {
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
									_data_->_tmp26_ = _data_->media;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
									g_object_get (_data_->_tmp26_, "live", &_data_->_tmp27_, NULL);
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
									_data_->_tmp28_ = _data_->_tmp27_;
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
									_data_->_tmp22_ = _data_->_tmp28_;
#line 2401 "os-database.c"
								}
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp16_ = _data_->_tmp22_;
#line 2405 "os-database.c"
							} else {
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp16_ = FALSE;
#line 2409 "os-database.c"
							}
#line 145 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							if (_data_->_tmp16_) {
#line 148 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp29_ = _data_->store;
#line 148 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								memset (&_data_->_tmp30_, 0, sizeof (GtkTreeIter));
#line 148 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								gtk_list_store_append (_data_->_tmp29_, &_data_->_tmp30_);
#line 148 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->iter = _data_->_tmp30_;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp31_ = _data_->store;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp32_ = _data_->iter;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp33_ = _data_->media;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								g_object_get (_data_->_tmp33_, "url", &_data_->_tmp34_, NULL);
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp35_ = _data_->_tmp34_;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_data_->_tmp36_ = _data_->_tmp35_;
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								gtk_list_store_set (_data_->_tmp31_, &_data_->_tmp32_, 0, _data_->_tmp36_, -1);
#line 149 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
								_g_free0 (_data_->_tmp36_);
#line 2437 "os-database.c"
							}
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
							_g_object_unref0 (_data_->media);
#line 2441 "os-database.c"
						}
					}
#line 142 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_g_list_free0 (_data_->media_entity_collection);
#line 2446 "os-database.c"
				}
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (_data_->os);
#line 2450 "os-database.c"
			}
		}
#line 139 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_list_free0 (_data_->entity_collection);
#line 2455 "os-database.c"
	}
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->store;
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 2467 "os-database.c"
		}
	}
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 154 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 2474 "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;
	OsinfoMediaList* _tmp0_;
	OsinfoMedia* media = NULL;
	OsinfoMediaList* _tmp1_;
	OsinfoEntity* _tmp2_;
	OsinfoMedia* _tmp3_;
	OsinfoMedia* _tmp4_;
	GError * _inner_error_ = NULL;
#line 157 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 157 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 157 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 158 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_os_get_media_list (os);
#line 158 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	medias = _tmp0_;
#line 160 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = medias;
#line 160 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = osinfo_list_find_by_id ((OsinfoList*) _tmp1_, id);
#line 160 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, osinfo_media_get_type ()) ? ((OsinfoMedia*) _tmp2_) : NULL);
#line 160 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	media = _tmp3_;
#line 161 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp4_ = media;
#line 161 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_tmp4_ == NULL) {
#line 2515 "os-database.c"
		GError* _tmp5_;
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp5_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID, "Unknown media ID '%s'", id);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_inner_error_ = _tmp5_;
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_propagate_error (error, _inner_error_);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return NULL;
#line 2531 "os-database.c"
		} else {
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 162 "/home/fborges/checkout/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 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_clear_error (&_inner_error_);
#line 162 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			return NULL;
#line 2543 "os-database.c"
		}
	}
#line 164 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = media;
#line 164 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (medias);
#line 164 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2552 "os-database.c"
}


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


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


static gchar**
_vala_array_dup3 (gchar** self,
                  int length)
{
	gchar** result;
	int i;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = g_new0 (gchar*, length + 1);
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	for (i = 0; i < length; i++) {
#line 2610 "os-database.c"
		gchar* _tmp0_;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp0_ = g_strdup (self[i]);
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result[i] = _tmp0_;
#line 2616 "os-database.c"
	}
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2620 "os-database.c"
}


OsinfoResources*
boxes_os_database_get_resources_for_os (BoxesOSDatabase* self,
                                        OsinfoOs* os,
                                        const gchar* architecture)
{
	OsinfoResources* result = NULL;
	gchar** architectures = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	gint architectures_length1;
	gint _architectures_size_;
	gchar** prefs = NULL;
	gint prefs_length1 = 0;
	gint _prefs_size_ = 0;
	OsinfoResourcesList* list = NULL;
	OsinfoResourcesList* _tmp17_;
	OsinfoResources* recommended = NULL;
	OsinfoResourcesList* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	OsinfoResources* _tmp20_;
	OsinfoResourcesList* _tmp21_;
	OsinfoResources* minimum = NULL;
	OsinfoResourcesList* _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	OsinfoResources* _tmp24_;
	OsinfoResources* _tmp25_;
	OsinfoResources* _tmp26_;
	OsinfoResources* _tmp27_;
#line 167 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 168 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (os == NULL) {
#line 2661 "os-database.c"
		OsinfoResources* _tmp0_;
#line 169 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp0_ = boxes_os_database_get_default_resources ();
#line 169 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = _tmp0_;
#line 169 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 2669 "os-database.c"
	}
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup ("x86_64");
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup ("i686");
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_strdup ("i386");
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp4_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp5_ = g_new0 (gchar*, 4 + 1);
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp5_[0] = _tmp1_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp5_[1] = _tmp2_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp5_[2] = _tmp3_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp5_[3] = _tmp4_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	architectures = _tmp5_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	architectures_length1 = 4;
#line 172 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_architectures_size_ = architectures_length1;
#line 174 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (architecture != NULL) {
#line 2697 "os-database.c"
		gchar** _tmp6_;
		gchar** _tmp7_;
		gint _tmp7__length1;
		gchar* _tmp8_;
		gchar** _tmp9_;
		gint _tmp9__length1;
#line 175 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp6_ = g_new0 (gchar*, 0 + 1);
#line 175 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 175 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs = _tmp6_;
#line 175 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs_length1 = 0;
#line 175 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 176 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp7_ = prefs;
#line 176 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp7__length1 = prefs_length1;
#line 176 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_strdup (architecture);
#line 176 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_vala_array_add7 (&prefs, &prefs_length1, &_prefs_size_, _tmp8_);
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp9_ = architectures;
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = architectures_length1;
#line 2726 "os-database.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			arch_collection = _tmp9_;
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			arch_collection_length1 = _tmp9__length1;
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			for (arch_it = 0; arch_it < _tmp9__length1; arch_it = arch_it + 1) {
#line 2738 "os-database.c"
				gchar* _tmp10_;
				gchar* arch = NULL;
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp10_ = g_strdup (arch_collection[arch_it]);
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				arch = _tmp10_;
#line 2745 "os-database.c"
				{
					const gchar* _tmp11_;
#line 179 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp11_ = arch;
#line 179 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					if (g_strcmp0 (_tmp11_, architecture) != 0) {
#line 2752 "os-database.c"
						gchar** _tmp12_;
						gint _tmp12__length1;
						const gchar* _tmp13_;
						gchar* _tmp14_;
#line 180 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_tmp12_ = prefs;
#line 180 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_tmp12__length1 = prefs_length1;
#line 180 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_tmp13_ = arch;
#line 180 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_tmp14_ = g_strdup (_tmp13_);
#line 180 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
						_vala_array_add8 (&prefs, &prefs_length1, &_prefs_size_, _tmp14_);
#line 2767 "os-database.c"
					}
#line 178 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_g_free0 (arch);
#line 2771 "os-database.c"
				}
			}
		}
	} else {
		gchar** _tmp15_;
		gint _tmp15__length1;
		gchar** _tmp16_;
		gint _tmp16__length1;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp15_ = architectures;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp15__length1 = architectures_length1;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp16_ = (_tmp15_ != NULL) ? _vala_array_dup3 (_tmp15_, _tmp15__length1) : ((gpointer) _tmp15_);
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp16__length1 = _tmp15__length1;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs = _tmp16_;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		prefs_length1 = _tmp16__length1;
#line 182 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 2796 "os-database.c"
	}
#line 185 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp17_ = osinfo_os_get_recommended_resources (os);
#line 185 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	list = _tmp17_;
#line 186 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp18_ = list;
#line 186 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp19_ = prefs;
#line 186 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp19__length1 = prefs_length1;
#line 186 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp20_ = boxes_os_database_get_prefered_resources (_tmp18_, _tmp19_, _tmp19__length1);
#line 186 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	recommended = _tmp20_;
#line 188 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp21_ = osinfo_os_get_minimum_resources (os);
#line 188 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 188 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	list = _tmp21_;
#line 189 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp22_ = list;
#line 189 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp23_ = prefs;
#line 189 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp23__length1 = prefs_length1;
#line 189 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp24_ = boxes_os_database_get_prefered_resources (_tmp22_, _tmp23_, _tmp23__length1);
#line 189 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	minimum = _tmp24_;
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp25_ = minimum;
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp26_ = recommended;
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp27_ = boxes_os_database_get_resources_from_os_resources (self, _tmp25_, _tmp26_);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _tmp27_;
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (minimum);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (recommended);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	architectures = (_vala_array_free (architectures, architectures_length1, (GDestroyNotify) g_free), NULL);
#line 191 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2848 "os-database.c"
}


OsinfoResources*
boxes_os_database_get_recommended_resources_for_os (OsinfoOs* os,
                                                    const gchar* architecture)
{
	OsinfoResources* result = NULL;
	gchar** prefs = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint prefs_length1;
	gint _prefs_size_;
	OsinfoResourcesList* list = NULL;
	OsinfoResourcesList* _tmp3_;
	OsinfoResources* _tmp4_;
#line 194 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 194 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (architecture != NULL, NULL);
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = g_strdup (architecture);
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_new0 (gchar*, 2 + 1);
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_[0] = _tmp0_;
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_[1] = _tmp1_;
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs = _tmp2_;
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs_length1 = 2;
#line 195 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_prefs_size_ = prefs_length1;
#line 197 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp3_ = osinfo_os_get_recommended_resources (os);
#line 197 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	list = _tmp3_;
#line 199 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp4_ = boxes_os_database_get_prefered_resources (list, prefs, prefs_length1);
#line 199 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _tmp4_;
#line 199 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 199 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 199 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2900 "os-database.c"
}


OsinfoResources*
boxes_os_database_get_minimum_resources_for_os (OsinfoOs* os,
                                                const gchar* architecture)
{
	OsinfoResources* result = NULL;
	gchar** prefs = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint prefs_length1;
	gint _prefs_size_;
	OsinfoResourcesList* list = NULL;
	OsinfoResourcesList* _tmp3_;
	OsinfoResources* _tmp4_;
#line 202 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 202 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (architecture != NULL, NULL);
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = g_strdup (architecture);
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_new0 (gchar*, 2 + 1);
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_[0] = _tmp0_;
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_[1] = _tmp1_;
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs = _tmp2_;
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs_length1 = 2;
#line 203 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_prefs_size_ = prefs_length1;
#line 205 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp3_ = osinfo_os_get_minimum_resources (os);
#line 205 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	list = _tmp3_;
#line 207 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp4_ = boxes_os_database_get_prefered_resources (list, prefs, prefs_length1);
#line 207 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _tmp4_;
#line 207 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 207 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 207 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 2952 "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_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp31_ = FALSE;
#line 210 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 211 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_os_database_get_default_resources ();
#line 211 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (recommended != NULL) {
#line 2975 "os-database.c"
		gint _tmp2_;
		gint _tmp3_;
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp2_ = osinfo_resources_get_n_cpus (recommended);
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp3_ = _tmp2_;
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp1_ = _tmp3_ > 0;
#line 2984 "os-database.c"
	} else {
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp1_ = FALSE;
#line 2988 "os-database.c"
	}
#line 214 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_tmp1_) {
#line 2992 "os-database.c"
		OsinfoResources* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
#line 215 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp4_ = resources;
#line 215 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp5_ = osinfo_resources_get_n_cpus (recommended);
#line 215 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp6_ = _tmp5_;
#line 215 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_n_cpus (_tmp4_, _tmp6_);
#line 3004 "os-database.c"
	} else {
		gboolean _tmp7_ = FALSE;
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (minimum != NULL) {
#line 3009 "os-database.c"
			gint _tmp8_;
			gint _tmp9_;
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp8_ = osinfo_resources_get_n_cpus (minimum);
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp9_ = _tmp8_;
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp7_ = _tmp9_ > 0;
#line 3018 "os-database.c"
		} else {
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp7_ = FALSE;
#line 3022 "os-database.c"
		}
#line 216 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_tmp7_) {
#line 3026 "os-database.c"
			OsinfoResources* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			OsinfoResources* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp10_ = resources;
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp11_ = osinfo_resources_get_n_cpus (minimum);
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp12_ = _tmp11_;
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp13_ = resources;
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp14_ = osinfo_resources_get_n_cpus (_tmp13_);
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp15_ = _tmp14_;
#line 217 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_n_cpus (_tmp10_, MAX (_tmp12_, _tmp15_));
#line 3047 "os-database.c"
		}
	}
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (recommended != NULL) {
#line 3052 "os-database.c"
		gint64 _tmp17_;
		gint64 _tmp18_;
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp17_ = osinfo_resources_get_ram (recommended);
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp18_ = _tmp17_;
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp16_ = _tmp18_ > ((gint64) 0);
#line 3061 "os-database.c"
	} else {
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp16_ = FALSE;
#line 3065 "os-database.c"
	}
#line 220 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_tmp16_) {
#line 3069 "os-database.c"
		OsinfoResources* _tmp19_;
		gint64 _tmp20_;
		gint64 _tmp21_;
#line 221 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp19_ = resources;
#line 221 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp20_ = osinfo_resources_get_ram (recommended);
#line 221 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp21_ = _tmp20_;
#line 221 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_ram (_tmp19_, _tmp21_);
#line 3081 "os-database.c"
	} else {
		gboolean _tmp22_ = FALSE;
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (minimum != NULL) {
#line 3086 "os-database.c"
			gint64 _tmp23_;
			gint64 _tmp24_;
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp23_ = osinfo_resources_get_ram (minimum);
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp24_ = _tmp23_;
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp22_ = _tmp24_ > ((gint64) 0);
#line 3095 "os-database.c"
		} else {
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp22_ = FALSE;
#line 3099 "os-database.c"
		}
#line 222 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_tmp22_) {
#line 3103 "os-database.c"
			OsinfoResources* _tmp25_;
			gint64 _tmp26_;
			gint64 _tmp27_;
			OsinfoResources* _tmp28_;
			gint64 _tmp29_;
			gint64 _tmp30_;
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp25_ = resources;
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp26_ = osinfo_resources_get_ram (minimum);
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp27_ = _tmp26_;
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp28_ = resources;
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp29_ = osinfo_resources_get_ram (_tmp28_);
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp30_ = _tmp29_;
#line 223 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_ram (_tmp25_, MAX (_tmp27_, _tmp30_));
#line 3124 "os-database.c"
		}
	}
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (recommended != NULL) {
#line 3129 "os-database.c"
		gint64 _tmp32_;
		gint64 _tmp33_;
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp32_ = osinfo_resources_get_storage (recommended);
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp33_ = _tmp32_;
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp31_ = _tmp33_ > ((gint64) 0);
#line 3138 "os-database.c"
	} else {
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp31_ = FALSE;
#line 3142 "os-database.c"
	}
#line 226 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_tmp31_) {
#line 3146 "os-database.c"
		OsinfoResources* _tmp34_;
		gint64 _tmp35_;
		gint64 _tmp36_;
#line 227 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp34_ = resources;
#line 227 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp35_ = osinfo_resources_get_storage (recommended);
#line 227 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp36_ = _tmp35_;
#line 227 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_storage (_tmp34_, _tmp36_);
#line 3158 "os-database.c"
	} else {
		gboolean _tmp37_ = FALSE;
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (minimum != NULL) {
#line 3163 "os-database.c"
			gint64 _tmp38_;
			gint64 _tmp39_;
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp38_ = osinfo_resources_get_storage (minimum);
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp39_ = _tmp38_;
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp37_ = _tmp39_ > ((gint64) 0);
#line 3172 "os-database.c"
		} else {
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp37_ = FALSE;
#line 3176 "os-database.c"
		}
#line 228 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_tmp37_) {
#line 3180 "os-database.c"
			OsinfoResources* _tmp40_;
			gint64 _tmp41_;
			gint64 _tmp42_;
			OsinfoResources* _tmp43_;
			gint64 _tmp44_;
			gint64 _tmp45_;
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp40_ = resources;
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp41_ = osinfo_resources_get_storage (minimum);
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp42_ = _tmp41_;
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp43_ = resources;
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp44_ = osinfo_resources_get_storage (_tmp43_);
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			_tmp45_ = _tmp44_;
#line 229 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_storage (_tmp40_, MAX (_tmp42_ * 2, _tmp45_));
#line 3201 "os-database.c"
		}
	}
#line 231 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = resources;
#line 231 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 3208 "os-database.c"
}


static OsinfoResources*
boxes_os_database_get_prefered_resources (OsinfoResourcesList* list,
                                          gchar** prefs,
                                          int prefs_length1)
{
	OsinfoResources* result = NULL;
	OsinfoResourcesList* filtered = NULL;
	const gchar* _tmp0_;
	OsinfoResourcesList* _tmp1_;
	OsinfoResourcesList* _tmp2_;
#line 234 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 235 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (prefs_length1 <= 0) {
#line 236 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = NULL;
#line 236 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 3230 "os-database.c"
	}
#line 238 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = prefs[0];
#line 238 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = boxes_os_database_filter_resources_list_by_arch (list, _tmp0_);
#line 238 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	filtered = _tmp1_;
#line 239 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp2_ = filtered;
#line 239 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (osinfo_list_get_length ((OsinfoList*) _tmp2_) <= 0) {
#line 3242 "os-database.c"
		OsinfoResources* _tmp3_;
#line 240 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp3_ = boxes_os_database_get_prefered_resources (list, prefs + 1, prefs_length1 - 1);
#line 240 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = _tmp3_;
#line 240 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 240 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 3252 "os-database.c"
	} else {
		OsinfoResourcesList* _tmp4_;
		OsinfoEntity* _tmp5_;
		OsinfoResources* _tmp6_;
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp4_ = filtered;
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp5_ = osinfo_list_get_nth ((OsinfoList*) _tmp4_, 0);
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp5_) : NULL);
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		result = _tmp6_;
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 244 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return result;
#line 3269 "os-database.c"
	}
#line 234 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (filtered);
#line 3273 "os-database.c"
}


static OsinfoResourcesList*
boxes_os_database_filter_resources_list_by_arch (OsinfoResourcesList* list,
                                                 const gchar* arch)
{
	OsinfoResourcesList* result = NULL;
	OsinfoResourcesList* new_list = NULL;
	OsinfoResourcesList* _tmp0_;
	GList* _tmp1_;
#line 247 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 247 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (arch != NULL, NULL);
#line 248 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resourceslist_new ();
#line 248 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	new_list = _tmp0_;
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_list_get_elements ((OsinfoList*) list);
#line 3295 "os-database.c"
	{
		GList* entity_collection = NULL;
		GList* entity_it = NULL;
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		entity_collection = _tmp1_;
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		for (entity_it = entity_collection; entity_it != NULL; entity_it = entity_it->next) {
#line 3303 "os-database.c"
			OsinfoEntity* entity = NULL;
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			entity = (OsinfoEntity*) entity_it->data;
#line 3307 "os-database.c"
			{
				OsinfoResources* resources = NULL;
				OsinfoEntity* _tmp2_;
				OsinfoResources* _tmp3_;
				BoxesCPUArchCompatibility compatibility = 0;
				OsinfoResources* _tmp4_;
				const gchar* _tmp5_;
				const gchar* _tmp6_;
				gboolean _tmp7_ = FALSE;
				BoxesCPUArchCompatibility _tmp8_;
#line 250 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp2_ = entity;
#line 250 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp2_) : NULL);
#line 250 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				resources = _tmp3_;
#line 251 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp4_ = resources;
#line 251 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp5_ = osinfo_resources_get_architecture (_tmp4_);
#line 251 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp6_ = _tmp5_;
#line 251 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				compatibility = boxes_compare_cpu_architectures (arch, _tmp6_);
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_tmp8_ = compatibility;
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				if (_tmp8_ == BOXES_CPU_ARCH_COMPATIBILITY_IDENTICAL) {
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp7_ = TRUE;
#line 3338 "os-database.c"
				} else {
					BoxesCPUArchCompatibility _tmp9_;
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp9_ = compatibility;
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp7_ = _tmp9_ == BOXES_CPU_ARCH_COMPATIBILITY_COMPATIBLE;
#line 3345 "os-database.c"
				}
#line 252 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				if (_tmp7_) {
#line 3349 "os-database.c"
					OsinfoResourcesList* _tmp10_;
					OsinfoResources* _tmp11_;
#line 253 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp10_ = new_list;
#line 253 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					_tmp11_ = resources;
#line 253 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
					osinfo_list_add ((OsinfoList*) _tmp10_, (OsinfoEntity*) _tmp11_);
#line 3358 "os-database.c"
				}
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				_g_object_unref0 (resources);
#line 3362 "os-database.c"
			}
		}
#line 249 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_list_free0 (entity_collection);
#line 3367 "os-database.c"
	}
#line 256 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = new_list;
#line 256 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 3373 "os-database.c"
}


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


static void
boxes_os_database_ensure_db_loaded_async_ready_wrapper (GObject *source_object,
                                                        GAsyncResult *res,
                                                        void *user_data)
{
	BoxesOsDatabaseEnsureDbLoadedData* _task_data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_task_data_->_callback_ != NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 3402 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_task_data_->_task_complete_ = TRUE;
#line 3406 "os-database.c"
}


static void
boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	BoxesOSDatabase* _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseEnsureDbLoadedData);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_callback_ = _callback_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_os_database_ensure_db_loaded_async_ready_wrapper, _user_data_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_callback_ == NULL) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_task_complete_ = TRUE;
#line 3427 "os-database.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_os_database_ensure_db_loaded_data_free);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data_);
#line 3437 "os-database.c"
}


static gboolean
boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self,
                                           GAsyncResult* _res_)
{
	gboolean result;
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return result;
#line 3453 "os-database.c"
}


static Block70Data*
block70_data_ref (Block70Data* _data70_)
{
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data70_->_ref_count_);
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return _data70_;
#line 3464 "os-database.c"
}


static void
block70_data_unref (void * _userdata_)
{
	Block70Data* _data70_;
	_data70_ = (Block70Data*) _userdata_;
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data70_->_ref_count_)) {
#line 3475 "os-database.c"
		BoxesOSDatabase* self;
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		self = _data70_->self;
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_slice_free (Block70Data, _data70_);
#line 3483 "os-database.c"
	}
}


static Block71Data*
block71_data_ref (Block71Data* _data71_)
{
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data71_->_ref_count_);
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return _data71_;
#line 3495 "os-database.c"
}


static void
block71_data_unref (void * _userdata_)
{
	Block71Data* _data71_;
	_data71_ = (Block71Data*) _userdata_;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data71_->_ref_count_)) {
#line 3506 "os-database.c"
		BoxesOSDatabase* self;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		self = _data71_->_data70_->self;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		block70_data_unref (_data71_->_data70_);
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data71_->_data70_ = NULL;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_slice_free (Block71Data, _data71_);
#line 3516 "os-database.c"
	}
}


static void
___lambda17_ (Block71Data* _data71_)
{
	Block70Data* _data70_;
	BoxesOSDatabase* self;
	gulong _tmp0_;
#line 266 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data70_ = _data71_->_data70_;
#line 266 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	self = _data70_->self;
#line 267 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data70_->_async_data_);
#line 268 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_tmp0_ = _data71_->db_loaded_id;
#line 268 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_signal_handler_disconnect ((GObject*) self, _tmp0_);
#line 3537 "os-database.c"
}


static void
____lambda17__boxes_os_database_db_loaded (BoxesOSDatabase* _sender,
                                           gpointer self)
{
#line 266 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	___lambda17_ (self);
#line 3547 "os-database.c"
}


static gboolean
boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_)
{
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 0:
#line 3558 "os-database.c"
		goto _state_0;
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		case 1:
#line 3562 "os-database.c"
		goto _state_1;
		default:
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 3567 "os-database.c"
	}
	_state_0:
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data70_ = g_slice_new0 (Block70Data);
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data70_->_ref_count_ = 1;
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data70_->self = g_object_ref (_data_->self);
#line 259 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data70_->_async_data_ = _data_;
#line 260 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = _data_->self->priv->db;
#line 260 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp0_ != NULL) {
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->result = TRUE;
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		block70_data_unref (_data_->_data70_);
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data70_ = NULL;
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ != 0) {
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 3596 "os-database.c"
			}
		}
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 261 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 3603 "os-database.c"
	}
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db_loading;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp1_) {
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_ = g_slice_new0 (Block71Data);
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_->_ref_count_ = 1;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_->_data70_ = block70_data_ref (_data_->_data70_);
#line 264 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_->db_loaded_id = (gulong) 0;
#line 266 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_signal_connect_data (_data_->self, "db-loaded", (GCallback) ____lambda17__boxes_os_database_db_loaded, block71_data_ref (_data_->_data71_), (GClosureNotify) block71_data_unref, 0);
#line 266 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_->db_loaded_id = _data_->_tmp2_;
#line 271 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 271 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 3625 "os-database.c"
		_state_1:
		;
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		block71_data_unref (_data_->_data71_);
#line 263 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		_data_->_data71_ = NULL;
#line 3632 "os-database.c"
	}
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp3_ != NULL;
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	block70_data_unref (_data_->_data70_);
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_data_->_data70_ = NULL;
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ != 0) {
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 3650 "os-database.c"
		}
	}
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 274 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 3657 "os-database.c"
}


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


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


static void
boxes_os_database_class_init (BoxesOSDatabaseClass * klass)
{
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_parent_class = g_type_class_peek_parent (klass);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	g_type_class_add_private (klass, sizeof (BoxesOSDatabasePrivate));
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_os_database_finalize;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	boxes_os_database_signals[BOXES_OS_DATABASE_DB_LOADED_SIGNAL] = 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 3693 "os-database.c"
}


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


static void
boxes_os_database_finalize (GObject * obj)
{
	BoxesOSDatabase * self;
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OS_DATABASE, BoxesOSDatabase);
#line 20 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (self->priv->db);
#line 12 "/home/fborges/checkout/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (boxes_os_database_parent_class)->finalize (obj);
#line 3716 "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 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 3741 "os-database.c"
		int i;
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
				destroy_func (((gpointer*) array)[i]);
#line 3749 "os-database.c"
			}
		}
	}
}


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



