/* priorityqueue.c generated by valac 0.25.3.11-62b1e, the Vala compiler
 * generated from priorityqueue.vala, do not modify */

/* priorityqueue.vala
 *
 * Copyright (C) 2009  Didier Villevalois
 * Copyright (C) 2012-2014  Maciej Piechotka
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 */

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


#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))

typedef struct _GeeTraversable GeeTraversable;
typedef struct _GeeTraversableIface GeeTraversableIface;

#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())

#define GEE_TYPE_LAZY (gee_lazy_get_type ())
#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))

typedef struct _GeeLazy GeeLazy;
typedef struct _GeeLazyClass GeeLazyClass;

#define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))

typedef struct _GeeIterator GeeIterator;
typedef struct _GeeIteratorIface GeeIteratorIface;

#define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))

typedef struct _GeeIterable GeeIterable;
typedef struct _GeeIterableIface GeeIterableIface;

#define GEE_TYPE_COLLECTION (gee_collection_get_type ())
#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))

typedef struct _GeeCollection GeeCollection;
typedef struct _GeeCollectionIface GeeCollectionIface;

#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))

typedef struct _GeeAbstractCollection GeeAbstractCollection;
typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;

#define GEE_TYPE_QUEUE (gee_queue_get_type ())
#define GEE_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_QUEUE, GeeQueue))
#define GEE_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_QUEUE))
#define GEE_QUEUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_QUEUE, GeeQueueIface))

typedef struct _GeeQueue GeeQueue;
typedef struct _GeeQueueIface GeeQueueIface;

#define GEE_TYPE_ABSTRACT_QUEUE (gee_abstract_queue_get_type ())
#define GEE_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueue))
#define GEE_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass))
#define GEE_IS_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_QUEUE))
#define GEE_IS_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_QUEUE))
#define GEE_ABSTRACT_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass))

typedef struct _GeeAbstractQueue GeeAbstractQueue;
typedef struct _GeeAbstractQueueClass GeeAbstractQueueClass;
typedef struct _GeeAbstractQueuePrivate GeeAbstractQueuePrivate;

#define GEE_TYPE_PRIORITY_QUEUE (gee_priority_queue_get_type ())
#define GEE_PRIORITY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue))
#define GEE_PRIORITY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueueClass))
#define GEE_IS_PRIORITY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_PRIORITY_QUEUE))
#define GEE_IS_PRIORITY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_PRIORITY_QUEUE))
#define GEE_PRIORITY_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueueClass))

typedef struct _GeePriorityQueue GeePriorityQueue;
typedef struct _GeePriorityQueueClass GeePriorityQueueClass;
typedef struct _GeePriorityQueuePrivate GeePriorityQueuePrivate;

#define GEE_PRIORITY_QUEUE_TYPE_NODE (gee_priority_queue_node_get_type ())
#define GEE_PRIORITY_QUEUE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode))
#define GEE_PRIORITY_QUEUE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNodeClass))
#define GEE_PRIORITY_QUEUE_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE))
#define GEE_PRIORITY_QUEUE_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_NODE))
#define GEE_PRIORITY_QUEUE_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNodeClass))

typedef struct _GeePriorityQueueNode GeePriorityQueueNode;
typedef struct _GeePriorityQueueNodeClass GeePriorityQueueNodeClass;

#define GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE (gee_priority_queue_type1_node_get_type ())
#define GEE_PRIORITY_QUEUE_TYPE1_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node))
#define GEE_PRIORITY_QUEUE_TYPE1_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1NodeClass))
#define GEE_PRIORITY_QUEUE_IS_TYPE1_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE))
#define GEE_PRIORITY_QUEUE_IS_TYPE1_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE))
#define GEE_PRIORITY_QUEUE_TYPE1_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1NodeClass))

typedef struct _GeePriorityQueueType1Node GeePriorityQueueType1Node;
typedef struct _GeePriorityQueueType1NodeClass GeePriorityQueueType1NodeClass;

#define GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE (gee_priority_queue_type2_node_get_type ())
#define GEE_PRIORITY_QUEUE_TYPE2_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE, GeePriorityQueueType2Node))
#define GEE_PRIORITY_QUEUE_TYPE2_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE, GeePriorityQueueType2NodeClass))
#define GEE_PRIORITY_QUEUE_IS_TYPE2_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE))
#define GEE_PRIORITY_QUEUE_IS_TYPE2_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE))
#define GEE_PRIORITY_QUEUE_TYPE2_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE, GeePriorityQueueType2NodeClass))

typedef struct _GeePriorityQueueType2Node GeePriorityQueueType2Node;
typedef struct _GeePriorityQueueType2NodeClass GeePriorityQueueType2NodeClass;
typedef struct _GeePriorityQueueNodePair GeePriorityQueueNodePair;
#define _gee_priority_queue_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_priority_queue_node_unref (var), NULL)))
#define _gee_priority_queue_node_pair_free0(var) ((var == NULL) ? NULL : (var = (gee_priority_queue_node_pair_free (var), NULL)))
typedef struct _GeePriorityQueueNodePrivate GeePriorityQueueNodePrivate;
typedef struct _GeePriorityQueueType1NodePrivate GeePriorityQueueType1NodePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GEE_PRIORITY_QUEUE_TYPE_ITERATOR (gee_priority_queue_iterator_get_type ())
#define GEE_PRIORITY_QUEUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIterator))
#define GEE_PRIORITY_QUEUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIteratorClass))
#define GEE_PRIORITY_QUEUE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_ITERATOR))
#define GEE_PRIORITY_QUEUE_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_ITERATOR))
#define GEE_PRIORITY_QUEUE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIteratorClass))

typedef struct _GeePriorityQueueIterator GeePriorityQueueIterator;
typedef struct _GeePriorityQueueIteratorClass GeePriorityQueueIteratorClass;
#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL)))
typedef struct _GeePriorityQueueParamSpecNode GeePriorityQueueParamSpecNode;
typedef struct _GeePriorityQueueType2NodePrivate GeePriorityQueueType2NodePrivate;

#define GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE (gee_priority_queue_dummy_node_get_type ())
#define GEE_PRIORITY_QUEUE_DUMMY_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE, GeePriorityQueueDummyNode))
#define GEE_PRIORITY_QUEUE_DUMMY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE, GeePriorityQueueDummyNodeClass))
#define GEE_PRIORITY_QUEUE_IS_DUMMY_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE))
#define GEE_PRIORITY_QUEUE_IS_DUMMY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE))
#define GEE_PRIORITY_QUEUE_DUMMY_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE, GeePriorityQueueDummyNodeClass))

typedef struct _GeePriorityQueueDummyNode GeePriorityQueueDummyNode;
typedef struct _GeePriorityQueueDummyNodeClass GeePriorityQueueDummyNodeClass;
typedef struct _GeePriorityQueueDummyNodePrivate GeePriorityQueueDummyNodePrivate;
typedef struct _GeePriorityQueueIteratorPrivate GeePriorityQueueIteratorPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
typedef enum  {
	GEE_TRAVERSABLE_STREAM_YIELD,
	GEE_TRAVERSABLE_STREAM_CONTINUE,
	GEE_TRAVERSABLE_STREAM_END,
	GEE_TRAVERSABLE_STREAM_WAIT
} GeeTraversableStream;

typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
struct _GeeIteratorIface {
	GTypeInterface parent_iface;
	gboolean (*next) (GeeIterator* self);
	gboolean (*has_next) (GeeIterator* self);
	gpointer (*get) (GeeIterator* self);
	void (*remove) (GeeIterator* self);
	gboolean (*get_valid) (GeeIterator* self);
	gboolean (*get_read_only) (GeeIterator* self);
};

typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
typedef GeeIterator* (*GeeFlatMapFunc) (gpointer g, void* user_data);
struct _GeeTraversableIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeTraversable* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
	GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
	gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
	GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
	gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
	GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
	GType (*get_element_type) (GeeTraversable* self);
	GeeIterator* (*flat_map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFlatMapFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
	GeeIterator** (*tee) (GeeTraversable* self, guint forks, int* result_length1);
};

struct _GeeIterableIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeIterable* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
	GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
	GeeIterator* (*iterator) (GeeIterable* self);
};

struct _GeeCollectionIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeCollection* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
	GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
	gboolean (*contains) (GeeCollection* self, gconstpointer item);
	gboolean (*add) (GeeCollection* self, gconstpointer item);
	gboolean (*remove) (GeeCollection* self, gconstpointer item);
	void (*clear) (GeeCollection* self);
	gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
	gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
	gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
	gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
	gpointer* (*to_array) (GeeCollection* self, int* result_length1);
	gint (*get_size) (GeeCollection* self);
	gboolean (*get_is_empty) (GeeCollection* self);
	gboolean (*get_read_only) (GeeCollection* self);
	GeeCollection* (*get_read_only_view) (GeeCollection* self);
	gboolean (*add_all_array) (GeeCollection* self, gpointer* array, int array_length1);
	gboolean (*contains_all_array) (GeeCollection* self, gpointer* array, int array_length1);
	gboolean (*remove_all_array) (GeeCollection* self, gpointer* array, int array_length1);
	gboolean (*add_all_iterator) (GeeCollection* self, GeeIterator* iter);
	gboolean (*contains_all_iterator) (GeeCollection* self, GeeIterator* iter);
	gboolean (*remove_all_iterator) (GeeCollection* self, GeeIterator* iter);
};

struct _GeeAbstractCollection {
	GObject parent_instance;
	GeeAbstractCollectionPrivate * priv;
};

struct _GeeAbstractCollectionClass {
	GObjectClass parent_class;
	gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
	gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
	gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
	void (*clear) (GeeAbstractCollection* self);
	GeeIterator* (*iterator) (GeeAbstractCollection* self);
	gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
	void (*reserved0) (GeeAbstractCollection* self);
	void (*reserved1) (GeeAbstractCollection* self);
	void (*reserved2) (GeeAbstractCollection* self);
	void (*reserved3) (GeeAbstractCollection* self);
	void (*reserved4) (GeeAbstractCollection* self);
	void (*reserved5) (GeeAbstractCollection* self);
	void (*reserved6) (GeeAbstractCollection* self);
	void (*reserved7) (GeeAbstractCollection* self);
	void (*reserved8) (GeeAbstractCollection* self);
	void (*reserved9) (GeeAbstractCollection* self);
	gint (*get_size) (GeeAbstractCollection* self);
	gboolean (*get_read_only) (GeeAbstractCollection* self);
	GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
};

struct _GeeQueueIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeQueue* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self);
	GDestroyNotify (*get_g_destroy_func) (GeeQueue* self);
	gboolean (*offer) (GeeQueue* self, gconstpointer element);
	gpointer (*peek) (GeeQueue* self);
	gpointer (*poll) (GeeQueue* self);
	gint (*drain) (GeeQueue* self, GeeCollection* recipient, gint amount);
	gint (*get_capacity) (GeeQueue* self);
	gint (*get_remaining_capacity) (GeeQueue* self);
	gboolean (*get_is_full) (GeeQueue* self);
};

struct _GeeAbstractQueue {
	GeeAbstractCollection parent_instance;
	GeeAbstractQueuePrivate * priv;
};

struct _GeeAbstractQueueClass {
	GeeAbstractCollectionClass parent_class;
	gpointer (*peek) (GeeAbstractQueue* self);
	gpointer (*poll) (GeeAbstractQueue* self);
	void (*reserved0) (GeeAbstractQueue* self);
	void (*reserved1) (GeeAbstractQueue* self);
	void (*reserved2) (GeeAbstractQueue* self);
	void (*reserved3) (GeeAbstractQueue* self);
	void (*reserved4) (GeeAbstractQueue* self);
	void (*reserved5) (GeeAbstractQueue* self);
	void (*reserved6) (GeeAbstractQueue* self);
	void (*reserved7) (GeeAbstractQueue* self);
	void (*reserved8) (GeeAbstractQueue* self);
	void (*reserved9) (GeeAbstractQueue* self);
	gint (*get_capacity) (GeeAbstractQueue* self);
	gint (*get_remaining_capacity) (GeeAbstractQueue* self);
	gboolean (*get_is_full) (GeeAbstractQueue* self);
};

struct _GeePriorityQueue {
	GeeAbstractQueue parent_instance;
	GeePriorityQueuePrivate * priv;
};

struct _GeePriorityQueueClass {
	GeeAbstractQueueClass parent_class;
};

struct _GeePriorityQueuePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	gint _size;
	gint _stamp;
	GeePriorityQueueType1Node* _r;
	GeePriorityQueueType2Node* _r_prime;
	GeePriorityQueueType2Node* _lm_head;
	GeePriorityQueueType2Node* _lm_tail;
	GeePriorityQueueType1Node* _p;
	GeePriorityQueueType1Node** _a;
	gint _a_length1;
	gint __a_size_;
	GeePriorityQueueNodePair* _lp_head;
	GeePriorityQueueNodePair* _lp_tail;
	gboolean* _b;
	gint _b_length1;
	gint __b_size_;
	GeePriorityQueueType1Node* _ll_head;
	GeePriorityQueueType1Node* _ll_tail;
	GeePriorityQueueNode* _iter_head;
	GeePriorityQueueNode* _iter_tail;
	GCompareDataFunc _compare_func;
	gpointer _compare_func_target;
	GDestroyNotify _compare_func_target_destroy_notify;
};

struct _GeePriorityQueueNode {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeePriorityQueueNodePrivate * priv;
	gpointer data;
	GeePriorityQueueNode* parent;
	gint type1_children_count;
	GeePriorityQueueType1Node* type1_children_head;
	GeePriorityQueueType1Node* type1_children_tail;
	GeePriorityQueueNode* iter_prev;
	GeePriorityQueueNode* iter_next;
	gboolean pending_drop;
};

struct _GeePriorityQueueNodeClass {
	GTypeClass parent_class;
	void (*finalize) (GeePriorityQueueNode *self);
};

struct _GeePriorityQueueType1Node {
	GeePriorityQueueNode parent_instance;
	GeePriorityQueueType1NodePrivate * priv;
	guint lost;
	GeePriorityQueueType1Node* brothers_prev;
	GeePriorityQueueType1Node* brothers_next;
	GeePriorityQueueType2Node* type2_child;
	GeePriorityQueueType1Node* ll_prev;
	GeePriorityQueueType1Node* ll_next;
	GeePriorityQueueNodePair* pair;
};

struct _GeePriorityQueueType1NodeClass {
	GeePriorityQueueNodeClass parent_class;
};

struct _GeePriorityQueueNodePair {
	GeePriorityQueueNodePair* lp_prev;
	GeePriorityQueueNodePair* lp_next;
	GeePriorityQueueType1Node* node1;
	GeePriorityQueueType1Node* node2;
};

struct _GeePriorityQueueNodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeePriorityQueueParamSpecNode {
	GParamSpec parent_instance;
};

struct _GeePriorityQueueType1NodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeePriorityQueueType2Node {
	GeePriorityQueueNode parent_instance;
	GeePriorityQueueType2NodePrivate * priv;
};

struct _GeePriorityQueueType2NodeClass {
	GeePriorityQueueNodeClass parent_class;
};

struct _GeePriorityQueueType2NodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeePriorityQueueDummyNode {
	GeePriorityQueueNode parent_instance;
	GeePriorityQueueDummyNodePrivate * priv;
};

struct _GeePriorityQueueDummyNodeClass {
	GeePriorityQueueNodeClass parent_class;
};

struct _GeePriorityQueueDummyNodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeePriorityQueueIterator {
	GObject parent_instance;
	GeePriorityQueueIteratorPrivate * priv;
	GeePriorityQueue* queue;
	GeePriorityQueueNode* position;
	GeePriorityQueueNode* previous;
	gint stamp;
};

struct _GeePriorityQueueIteratorClass {
	GObjectClass parent_class;
};

struct _GeePriorityQueueIteratorPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};


static gpointer gee_priority_queue_parent_class = NULL;
static gpointer gee_priority_queue_node_parent_class = NULL;
static gpointer gee_priority_queue_type1_node_parent_class = NULL;
static gpointer gee_priority_queue_type2_node_parent_class = NULL;
static gpointer gee_priority_queue_dummy_node_parent_class = NULL;
static gpointer gee_priority_queue_iterator_parent_class = NULL;
static GeeTraversableIface* gee_priority_queue_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface* gee_priority_queue_iterator_gee_iterator_parent_iface = NULL;

GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
gpointer gee_lazy_ref (gpointer instance);
void gee_lazy_unref (gpointer instance);
GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gee_value_set_lazy (GValue* value, gpointer v_object);
void gee_value_take_lazy (GValue* value, gpointer v_object);
gpointer gee_value_get_lazy (const GValue* value);
GType gee_lazy_get_type (void) G_GNUC_CONST;
GType gee_iterator_get_type (void) G_GNUC_CONST;
GType gee_traversable_get_type (void) G_GNUC_CONST;
GType gee_iterable_get_type (void) G_GNUC_CONST;
GType gee_collection_get_type (void) G_GNUC_CONST;
GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
GType gee_queue_get_type (void) G_GNUC_CONST;
GType gee_abstract_queue_get_type (void) G_GNUC_CONST;
GType gee_priority_queue_get_type (void) G_GNUC_CONST;
static gpointer gee_priority_queue_node_ref (gpointer instance);
static void gee_priority_queue_node_unref (gpointer instance);
static GParamSpec* gee_priority_queue_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void gee_priority_queue_value_set_node (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void gee_priority_queue_value_take_node (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer gee_priority_queue_value_get_node (const GValue* value) G_GNUC_UNUSED;
static GType gee_priority_queue_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType gee_priority_queue_type1_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType gee_priority_queue_type2_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static void gee_priority_queue_node_pair_free (GeePriorityQueueNodePair* self);
#define GEE_PRIORITY_QUEUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueuePrivate))
enum  {
	GEE_PRIORITY_QUEUE_DUMMY_PROPERTY,
	GEE_PRIORITY_QUEUE_G_TYPE,
	GEE_PRIORITY_QUEUE_G_DUP_FUNC,
	GEE_PRIORITY_QUEUE_G_DESTROY_FUNC,
	GEE_PRIORITY_QUEUE_CAPACITY,
	GEE_PRIORITY_QUEUE_REMAINING_CAPACITY,
	GEE_PRIORITY_QUEUE_IS_FULL,
	GEE_PRIORITY_QUEUE_READ_ONLY,
	GEE_PRIORITY_QUEUE_SIZE
};
GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element);
static GeePriorityQueueType1Node* gee_priority_queue_type1_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail);
static GeePriorityQueueType1Node* gee_priority_queue_type1_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail);
static GeePriorityQueueType2Node* gee_priority_queue_type2_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail);
static GeePriorityQueueType2Node* gee_priority_queue_type2_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail);
static inline gint _gee_priority_queue_compare (GeePriorityQueue* self, GeePriorityQueueNode* node1, GeePriorityQueueNode* node2);
static inline void _gee_priority_queue_swap_data (GeePriorityQueue* self, GeePriorityQueueNode* node1, GeePriorityQueueNode* node2);
static void _gee_priority_queue_add (GeePriorityQueue* self, GeePriorityQueueType1Node* n);
static gpointer gee_priority_queue_real_peek (GeeAbstractQueue* base);
static gpointer gee_priority_queue_real_poll (GeeAbstractQueue* base);
static inline void _gee_priority_queue_move_data (GeePriorityQueue* self, GeePriorityQueueNode* target, GeePriorityQueueNode* source);
static void _gee_priority_queue_remove_type2_node (GeePriorityQueue* self, GeePriorityQueueType2Node* node, gboolean with_iteration);
static void _gee_priority_queue_remove_type1_node (GeePriorityQueue* self, GeePriorityQueueType1Node* node, gboolean with_iteration);
static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePriorityQueueType1Node* node);
static void _gee_priority_queue_adjust (GeePriorityQueue* self, GeePriorityQueueType1Node* p1, GeePriorityQueueType1Node* p2);
static gboolean _gee_priority_queue_check_linkable (GeePriorityQueue* self);
gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount);
gboolean gee_collection_add (GeeCollection* self, gconstpointer item);
gpointer gee_abstract_queue_poll (GeeAbstractQueue* self);
static gboolean gee_priority_queue_real_contains (GeeAbstractCollection* base, gconstpointer item);
GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self);
gboolean gee_iterator_next (GeeIterator* self);
gpointer gee_iterator_get (GeeIterator* self);
GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target);
static gboolean gee_priority_queue_real_add (GeeAbstractCollection* base, gconstpointer item);
static gboolean gee_priority_queue_real_remove (GeeAbstractCollection* base, gconstpointer item);
static GType gee_priority_queue_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GeePriorityQueueIterator* gee_priority_queue_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue);
static GeePriorityQueueIterator* gee_priority_queue_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue);
void gee_iterator_remove (GeeIterator* self);
static void gee_priority_queue_real_clear (GeeAbstractCollection* base);
static GeeIterator* gee_priority_queue_real_iterator (GeeAbstractCollection* base);
static gboolean gee_priority_queue_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target);
static void _gee_priority_queue_link (GeePriorityQueue* self, GeePriorityQueueType1Node* ri, GeePriorityQueueType1Node* rj);
static inline gint gee_priority_queue_node_degree (GeePriorityQueueNode* self);
static void _gee_priority_queue_add_to (GeePriorityQueue* self, GeePriorityQueueType1Node* node, GeePriorityQueueType1Node* parent);
static GeePriorityQueueNode* _gee_priority_queue_re_insert (GeePriorityQueue* self, GeePriorityQueueType1Node* n);
static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n);
static void _gee_priority_queue_decrease_key (GeePriorityQueue* self, GeePriorityQueueNode* n);
static inline void gee_priority_queue_type1_node_add (GeePriorityQueueType1Node* self, GeePriorityQueueType1Node* node);
static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2);
static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2);
static void _gee_priority_queue_updated_degree (GeePriorityQueue* self, GeePriorityQueueType1Node* node, gboolean child_removed);
static inline void gee_priority_queue_type1_node_remove (GeePriorityQueueType1Node* self);
static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareDataFunc value, gpointer value_target);
#define GEE_QUEUE_UNBOUNDED_CAPACITY (-1)
#define GEE_PRIORITY_QUEUE_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNodePrivate))
enum  {
	GEE_PRIORITY_QUEUE_NODE_DUMMY_PROPERTY
};
static GeePriorityQueueNode* gee_priority_queue_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail);
static void gee_priority_queue_node_finalize (GeePriorityQueueNode* obj);
#define GEE_PRIORITY_QUEUE_TYPE1_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1NodePrivate))
enum  {
	GEE_PRIORITY_QUEUE_TYPE1_NODE_DUMMY_PROPERTY
};
static void gee_priority_queue_type1_node_finalize (GeePriorityQueueNode* obj);
#define GEE_PRIORITY_QUEUE_TYPE2_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE, GeePriorityQueueType2NodePrivate))
enum  {
	GEE_PRIORITY_QUEUE_TYPE2_NODE_DUMMY_PROPERTY
};
static GType gee_priority_queue_dummy_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GEE_PRIORITY_QUEUE_DUMMY_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE, GeePriorityQueueDummyNodePrivate))
enum  {
	GEE_PRIORITY_QUEUE_DUMMY_NODE_DUMMY_PROPERTY
};
static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next);
static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next);
static void gee_priority_queue_node_pair_instance_init (GeePriorityQueueNodePair * self);
#define GEE_PRIORITY_QUEUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIteratorPrivate))
enum  {
	GEE_PRIORITY_QUEUE_ITERATOR_DUMMY_PROPERTY,
	GEE_PRIORITY_QUEUE_ITERATOR_G_TYPE,
	GEE_PRIORITY_QUEUE_ITERATOR_G_DUP_FUNC,
	GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC,
	GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY,
	GEE_PRIORITY_QUEUE_ITERATOR_VALID
};
static GeePriorityQueueIterator* gee_priority_queue_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueIterator* iter);
static GeePriorityQueueIterator* gee_priority_queue_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueIterator* iter);
static gboolean gee_priority_queue_iterator_real_next (GeeIterator* base);
static inline GeePriorityQueueNode* _gee_priority_queue_iterator_get_next_node (GeePriorityQueueIterator* self);
static gboolean gee_priority_queue_iterator_real_has_next (GeeIterator* base);
static gpointer gee_priority_queue_iterator_real_get (GeeIterator* base);
static void gee_priority_queue_iterator_real_remove (GeeIterator* base);
static gboolean gee_priority_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
static GeeIterator** gee_priority_queue_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1);
static void gee_priority_queue_iterator_finalize (GObject* obj);
gboolean gee_iterator_get_read_only (GeeIterator* self);
gboolean gee_iterator_get_valid (GeeIterator* self);
static void _vala_gee_priority_queue_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_priority_queue_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void gee_priority_queue_finalize (GObject* obj);
gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self);
gint gee_abstract_queue_get_remaining_capacity (GeeAbstractQueue* self);
gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self);
gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self);
gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
static void _vala_gee_priority_queue_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_priority_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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);


/**
 * Constructs a new, empty priority queue.
 *
 * If not provided, the function parameter is requested to the
 * {@link Functions} function factory methods.
 *
 * @param compare_func an optional element comparator function
 */
GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) {
	GeePriorityQueue * self = NULL;
	GCompareDataFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GCompareDataFunc _tmp4_ = NULL;
	void* _tmp4__target = NULL;
	GDestroyNotify _tmp4__target_destroy_notify = NULL;
	self = (GeePriorityQueue*) gee_abstract_queue_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = compare_func;
	_tmp0__target = compare_func_target;
	if (_tmp0_ == NULL) {
		void* _tmp1_ = NULL;
		GDestroyNotify _tmp2_ = NULL;
		GCompareDataFunc _tmp3_ = NULL;
		_tmp3_ = gee_functions_get_compare_func_for (g_type, &_tmp1_, &_tmp2_);
		(compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL);
		compare_func = NULL;
		compare_func_target = NULL;
		compare_func_target_destroy_notify = NULL;
		compare_func = _tmp3_;
		compare_func_target = _tmp1_;
		compare_func_target_destroy_notify = _tmp2_;
	}
	_tmp4_ = compare_func;
	_tmp4__target = compare_func_target;
	_tmp4__target_destroy_notify = compare_func_target_destroy_notify;
	compare_func_target_destroy_notify = NULL;
	(self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL);
	self->priv->_compare_func = NULL;
	self->priv->_compare_func_target = NULL;
	self->priv->_compare_func_target_destroy_notify = NULL;
	self->priv->_compare_func = _tmp4_;
	self->priv->_compare_func_target = _tmp4__target;
	self->priv->_compare_func_target_destroy_notify = _tmp4__target_destroy_notify;
	(compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL);
	compare_func = NULL;
	compare_func_target = NULL;
	compare_func_target_destroy_notify = NULL;
	return self;
}


GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) {
	return gee_priority_queue_construct (GEE_TYPE_PRIORITY_QUEUE, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify);
}


/**
 * {@inheritDoc}
 */
static gpointer _gee_priority_queue_node_ref0 (gpointer self) {
	return self ? gee_priority_queue_node_ref (self) : NULL;
}


gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element) {
	gboolean result = FALSE;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	gint _tmp21_ = 0;
	gint _tmp22_ = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_r;
	if (_tmp0_ == NULL) {
		gconstpointer _tmp1_ = NULL;
		GeePriorityQueueType1Node* _tmp2_ = NULL;
		GeePriorityQueueType1Node* _tmp3_ = NULL;
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		_tmp1_ = element;
		_tmp2_ = gee_priority_queue_type1_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, &self->priv->_iter_head, &self->priv->_iter_tail);
		_gee_priority_queue_node_unref0 (self->priv->_r);
		self->priv->_r = _tmp2_;
		_tmp3_ = self->priv->_r;
		_tmp4_ = _gee_priority_queue_node_ref0 (_tmp3_);
		_gee_priority_queue_node_unref0 (self->priv->_p);
		self->priv->_p = _tmp4_;
	} else {
		GeePriorityQueueType2Node* _tmp5_ = NULL;
		_tmp5_ = self->priv->_r_prime;
		if (_tmp5_ == NULL) {
			gconstpointer _tmp6_ = NULL;
			GeePriorityQueueType2Node* _tmp7_ = NULL;
			GeePriorityQueueType2Node* _tmp8_ = NULL;
			GeePriorityQueueType1Node* _tmp9_ = NULL;
			GeePriorityQueueType1Node* _tmp10_ = NULL;
			GeePriorityQueueType2Node* _tmp11_ = NULL;
			GeePriorityQueueType2Node* _tmp12_ = NULL;
			GeePriorityQueueType2Node* _tmp13_ = NULL;
			GeePriorityQueueType1Node* _tmp14_ = NULL;
			gint _tmp15_ = 0;
			_tmp6_ = element;
			_tmp7_ = gee_priority_queue_type2_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, &self->priv->_iter_head, &self->priv->_iter_tail);
			_gee_priority_queue_node_unref0 (self->priv->_r_prime);
			self->priv->_r_prime = _tmp7_;
			_tmp8_ = self->priv->_r_prime;
			_tmp9_ = self->priv->_r;
			((GeePriorityQueueNode*) _tmp8_)->parent = (GeePriorityQueueNode*) _tmp9_;
			_tmp10_ = self->priv->_r;
			_tmp11_ = self->priv->_r_prime;
			_tmp12_ = _gee_priority_queue_node_ref0 (_tmp11_);
			_gee_priority_queue_node_unref0 (_tmp10_->type2_child);
			_tmp10_->type2_child = _tmp12_;
			_tmp13_ = self->priv->_r_prime;
			_tmp14_ = self->priv->_r;
			_tmp15_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp13_, (GeePriorityQueueNode*) _tmp14_);
			if (_tmp15_ < 0) {
				GeePriorityQueueType2Node* _tmp16_ = NULL;
				GeePriorityQueueType1Node* _tmp17_ = NULL;
				_tmp16_ = self->priv->_r_prime;
				_tmp17_ = self->priv->_r;
				_gee_priority_queue_swap_data (self, (GeePriorityQueueNode*) _tmp16_, (GeePriorityQueueNode*) _tmp17_);
			}
		} else {
			GeePriorityQueueType1Node* node = NULL;
			gconstpointer _tmp18_ = NULL;
			GeePriorityQueueType1Node* _tmp19_ = NULL;
			GeePriorityQueueType1Node* _tmp20_ = NULL;
			_tmp18_ = element;
			_tmp19_ = gee_priority_queue_type1_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp18_, &self->priv->_iter_head, &self->priv->_iter_tail);
			node = _tmp19_;
			_tmp20_ = node;
			_gee_priority_queue_add (self, _tmp20_);
			_gee_priority_queue_node_unref0 (node);
		}
	}
	_tmp21_ = self->priv->_stamp;
	self->priv->_stamp = _tmp21_ + 1;
	_tmp22_ = self->priv->_size;
	self->priv->_size = _tmp22_ + 1;
	result = TRUE;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_priority_queue_real_peek (GeeAbstractQueue* base) {
	GeePriorityQueue * self;
	gpointer result = NULL;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	self = (GeePriorityQueue*) base;
	_tmp0_ = self->priv->_r;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->_r;
	_tmp2_ = ((GeePriorityQueueNode*) _tmp1_)->data;
	_tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	result = _tmp3_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_priority_queue_real_poll (GeeAbstractQueue* base) {
	GeePriorityQueue * self;
	gpointer result = NULL;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	gpointer min = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	GeePriorityQueueType1Node* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	GeePriorityQueueType2Node* _tmp7_ = NULL;
	GeePriorityQueueType1Node* _tmp28_ = NULL;
	GeePriorityQueueType2Node* _tmp29_ = NULL;
	GeePriorityQueueType2Node* _tmp30_ = NULL;
	GeePriorityQueueType1Node* _tmp31_ = NULL;
	GeePriorityQueueType1Node* r_second = NULL;
	GeePriorityQueueType1Node* node = NULL;
	GeePriorityQueueType2Node* _tmp33_ = NULL;
	GeePriorityQueueType1Node* _tmp34_ = NULL;
	GeePriorityQueueType1Node* _tmp35_ = NULL;
	GeePriorityQueueType2Node* _tmp47_ = NULL;
	GeePriorityQueueType1Node* _tmp48_ = NULL;
	GeePriorityQueueType1Node* _tmp49_ = NULL;
	GeePriorityQueueType1Node* _tmp50_ = NULL;
	GeePriorityQueueType1Node* _tmp51_ = NULL;
	GeePriorityQueueType1Node* _tmp52_ = NULL;
	GeePriorityQueueType1Node* _tmp61_ = NULL;
	GeePriorityQueueType1Node* _tmp62_ = NULL;
	self = (GeePriorityQueue*) base;
	_tmp0_ = self->priv->_r;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->_r;
	_tmp2_ = ((GeePriorityQueueNode*) _tmp1_)->data;
	_tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	min = _tmp3_;
	_tmp4_ = self->priv->_r;
	((GeePriorityQueueNode*) _tmp4_)->pending_drop = FALSE;
	_tmp5_ = self->priv->_stamp;
	self->priv->_stamp = _tmp5_ + 1;
	_tmp6_ = self->priv->_size;
	self->priv->_size = _tmp6_ - 1;
	_tmp7_ = self->priv->_r_prime;
	if (_tmp7_ == NULL) {
		GeePriorityQueueType1Node* _tmp8_ = NULL;
		GeePriorityQueueNode* _tmp9_ = NULL;
		GeePriorityQueueType1Node* _tmp14_ = NULL;
		GeePriorityQueueNode* _tmp15_ = NULL;
		GeePriorityQueueNode* _tmp20_ = NULL;
		GeePriorityQueueType1Node* _tmp21_ = NULL;
		GeePriorityQueueNode* _tmp24_ = NULL;
		GeePriorityQueueType1Node* _tmp25_ = NULL;
		_tmp8_ = self->priv->_r;
		_tmp9_ = ((GeePriorityQueueNode*) _tmp8_)->iter_next;
		if (_tmp9_ != NULL) {
			GeePriorityQueueType1Node* _tmp10_ = NULL;
			GeePriorityQueueNode* _tmp11_ = NULL;
			GeePriorityQueueType1Node* _tmp12_ = NULL;
			GeePriorityQueueNode* _tmp13_ = NULL;
			_tmp10_ = self->priv->_r;
			_tmp11_ = ((GeePriorityQueueNode*) _tmp10_)->iter_next;
			_tmp12_ = self->priv->_r;
			_tmp13_ = ((GeePriorityQueueNode*) _tmp12_)->iter_prev;
			_tmp11_->iter_prev = _tmp13_;
		}
		_tmp14_ = self->priv->_r;
		_tmp15_ = ((GeePriorityQueueNode*) _tmp14_)->iter_prev;
		if (_tmp15_ != NULL) {
			GeePriorityQueueType1Node* _tmp16_ = NULL;
			GeePriorityQueueNode* _tmp17_ = NULL;
			GeePriorityQueueType1Node* _tmp18_ = NULL;
			GeePriorityQueueNode* _tmp19_ = NULL;
			_tmp16_ = self->priv->_r;
			_tmp17_ = ((GeePriorityQueueNode*) _tmp16_)->iter_prev;
			_tmp18_ = self->priv->_r;
			_tmp19_ = ((GeePriorityQueueNode*) _tmp18_)->iter_next;
			_tmp17_->iter_next = _tmp19_;
		}
		_tmp20_ = self->priv->_iter_head;
		_tmp21_ = self->priv->_r;
		if (_tmp20_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
			GeePriorityQueueType1Node* _tmp22_ = NULL;
			GeePriorityQueueNode* _tmp23_ = NULL;
			_tmp22_ = self->priv->_r;
			_tmp23_ = ((GeePriorityQueueNode*) _tmp22_)->iter_next;
			self->priv->_iter_head = _tmp23_;
		}
		_tmp24_ = self->priv->_iter_tail;
		_tmp25_ = self->priv->_r;
		if (_tmp24_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
			GeePriorityQueueType1Node* _tmp26_ = NULL;
			GeePriorityQueueNode* _tmp27_ = NULL;
			_tmp26_ = self->priv->_r;
			_tmp27_ = ((GeePriorityQueueNode*) _tmp26_)->iter_prev;
			self->priv->_iter_tail = _tmp27_;
		}
		_gee_priority_queue_node_unref0 (self->priv->_r);
		self->priv->_r = NULL;
		_gee_priority_queue_node_unref0 (self->priv->_p);
		self->priv->_p = NULL;
		result = min;
		return result;
	}
	_tmp28_ = self->priv->_r;
	_tmp29_ = self->priv->_r_prime;
	_gee_priority_queue_move_data (self, (GeePriorityQueueNode*) _tmp28_, (GeePriorityQueueNode*) _tmp29_);
	_tmp30_ = self->priv->_r_prime;
	_tmp31_ = ((GeePriorityQueueNode*) _tmp30_)->type1_children_head;
	if (_tmp31_ == NULL) {
		GeePriorityQueueType2Node* _tmp32_ = NULL;
		_tmp32_ = self->priv->_r_prime;
		_gee_priority_queue_remove_type2_node (self, _tmp32_, TRUE);
		_gee_priority_queue_node_unref0 (self->priv->_r_prime);
		self->priv->_r_prime = NULL;
		result = min;
		return result;
	}
	r_second = NULL;
	_tmp33_ = self->priv->_r_prime;
	_tmp34_ = ((GeePriorityQueueNode*) _tmp33_)->type1_children_head;
	_tmp35_ = _gee_priority_queue_node_ref0 (_tmp34_);
	node = _tmp35_;
	while (TRUE) {
		GeePriorityQueueType1Node* _tmp36_ = NULL;
		gboolean _tmp37_ = FALSE;
		GeePriorityQueueType1Node* _tmp38_ = NULL;
		GeePriorityQueueType1Node* _tmp44_ = NULL;
		GeePriorityQueueType1Node* _tmp45_ = NULL;
		GeePriorityQueueType1Node* _tmp46_ = NULL;
		_tmp36_ = node;
		if (!(_tmp36_ != NULL)) {
			break;
		}
		_tmp38_ = r_second;
		if (_tmp38_ == NULL) {
			_tmp37_ = TRUE;
		} else {
			GeePriorityQueueType1Node* _tmp39_ = NULL;
			GeePriorityQueueType1Node* _tmp40_ = NULL;
			gint _tmp41_ = 0;
			_tmp39_ = node;
			_tmp40_ = r_second;
			_tmp41_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp39_, (GeePriorityQueueNode*) _tmp40_);
			_tmp37_ = _tmp41_ < 0;
		}
		if (_tmp37_) {
			GeePriorityQueueType1Node* _tmp42_ = NULL;
			GeePriorityQueueType1Node* _tmp43_ = NULL;
			_tmp42_ = node;
			_tmp43_ = _gee_priority_queue_node_ref0 (_tmp42_);
			_gee_priority_queue_node_unref0 (r_second);
			r_second = _tmp43_;
		}
		_tmp44_ = node;
		_tmp45_ = _tmp44_->brothers_next;
		_tmp46_ = _gee_priority_queue_node_ref0 (_tmp45_);
		_gee_priority_queue_node_unref0 (node);
		node = _tmp46_;
	}
	_tmp47_ = self->priv->_r_prime;
	_tmp48_ = r_second;
	_gee_priority_queue_move_data (self, (GeePriorityQueueNode*) _tmp47_, (GeePriorityQueueNode*) _tmp48_);
	_tmp49_ = r_second;
	_gee_priority_queue_remove_type1_node (self, _tmp49_, TRUE);
	_tmp50_ = r_second;
	_tmp51_ = ((GeePriorityQueueNode*) _tmp50_)->type1_children_head;
	_tmp52_ = _gee_priority_queue_node_ref0 (_tmp51_);
	_gee_priority_queue_node_unref0 (node);
	node = _tmp52_;
	while (TRUE) {
		GeePriorityQueueType1Node* _tmp53_ = NULL;
		GeePriorityQueueType1Node* next = NULL;
		GeePriorityQueueType1Node* _tmp54_ = NULL;
		GeePriorityQueueType1Node* _tmp55_ = NULL;
		GeePriorityQueueType1Node* _tmp56_ = NULL;
		GeePriorityQueueType1Node* _tmp57_ = NULL;
		GeePriorityQueueType1Node* _tmp58_ = NULL;
		GeePriorityQueueType1Node* _tmp59_ = NULL;
		GeePriorityQueueType1Node* _tmp60_ = NULL;
		_tmp53_ = node;
		if (!(_tmp53_ != NULL)) {
			break;
		}
		_tmp54_ = node;
		_tmp55_ = _tmp54_->brothers_next;
		_tmp56_ = _gee_priority_queue_node_ref0 (_tmp55_);
		next = _tmp56_;
		_tmp57_ = node;
		_gee_priority_queue_remove_type1_node (self, _tmp57_, FALSE);
		_tmp58_ = node;
		_gee_priority_queue_add_in_r_prime (self, _tmp58_);
		_tmp59_ = next;
		_tmp60_ = _gee_priority_queue_node_ref0 (_tmp59_);
		_gee_priority_queue_node_unref0 (node);
		node = _tmp60_;
		_gee_priority_queue_node_unref0 (next);
	}
	_tmp61_ = self->priv->_p;
	_tmp62_ = self->priv->_p;
	_gee_priority_queue_adjust (self, _tmp61_, _tmp62_);
	while (TRUE) {
		gboolean _tmp63_ = FALSE;
		_tmp63_ = _gee_priority_queue_check_linkable (self);
		if (!_tmp63_) {
			break;
		}
	}
	result = min;
	_gee_priority_queue_node_unref0 (node);
	_gee_priority_queue_node_unref0 (r_second);
	return result;
}


/**
 * {@inheritDoc}
 */
gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount) {
	gint result = 0;
	gint _tmp0_ = 0;
	gint _tmp10_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (recipient != NULL, 0);
	_tmp0_ = amount;
	if (_tmp0_ == (-1)) {
		gint _tmp1_ = 0;
		_tmp1_ = self->priv->_size;
		amount = _tmp1_;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				GeeCollection* _tmp7_ = NULL;
				gpointer _tmp8_ = NULL;
				gpointer _tmp9_ = NULL;
				if (!_tmp2_) {
					gint _tmp3_ = 0;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = amount;
				if (!(_tmp4_ < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->_size;
				if (_tmp6_ == 0) {
					result = i;
					return result;
				}
				_tmp7_ = recipient;
				_tmp8_ = gee_abstract_queue_poll ((GeeAbstractQueue*) self);
				_tmp9_ = _tmp8_;
				gee_collection_add (_tmp7_, _tmp9_);
				((_tmp9_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->g_destroy_func (_tmp9_), NULL));
			}
		}
	}
	_tmp10_ = amount;
	result = _tmp10_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gboolean gee_priority_queue_real_contains (GeeAbstractCollection* base, gconstpointer item) {
	GeePriorityQueue * self;
	gboolean result = FALSE;
	self = (GeePriorityQueue*) base;
	{
		GeeIterator* _an_item_it = NULL;
		GeeIterator* _tmp0_ = NULL;
		_tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
		_an_item_it = _tmp0_;
		while (TRUE) {
			GeeIterator* _tmp1_ = NULL;
			gboolean _tmp2_ = FALSE;
			gpointer an_item = NULL;
			GeeIterator* _tmp3_ = NULL;
			gpointer _tmp4_ = NULL;
			GCompareDataFunc _tmp5_ = NULL;
			void* _tmp5__target = NULL;
			GCompareDataFunc _tmp6_ = NULL;
			void* _tmp6__target = NULL;
			gconstpointer _tmp7_ = NULL;
			gconstpointer _tmp8_ = NULL;
			gint _tmp9_ = 0;
			_tmp1_ = _an_item_it;
			_tmp2_ = gee_iterator_next (_tmp1_);
			if (!_tmp2_) {
				break;
			}
			_tmp3_ = _an_item_it;
			_tmp4_ = gee_iterator_get (_tmp3_);
			an_item = _tmp4_;
			_tmp5_ = gee_priority_queue_get_compare_func (self, &_tmp5__target);
			_tmp6_ = _tmp5_;
			_tmp6__target = _tmp5__target;
			_tmp7_ = item;
			_tmp8_ = an_item;
			_tmp9_ = _tmp6_ (_tmp7_, _tmp8_, _tmp6__target);
			if (_tmp9_ == 0) {
				result = TRUE;
				((an_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (an_item = (self->priv->g_destroy_func (an_item), NULL));
				_g_object_unref0 (_an_item_it);
				return result;
			}
			((an_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (an_item = (self->priv->g_destroy_func (an_item), NULL));
		}
		_g_object_unref0 (_an_item_it);
	}
	result = FALSE;
	return result;
}


/**
 * {@inheritDoc}
 */
static gboolean gee_priority_queue_real_add (GeeAbstractCollection* base, gconstpointer item) {
	GeePriorityQueue * self;
	gboolean result = FALSE;
	gconstpointer _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	self = (GeePriorityQueue*) base;
	_tmp0_ = item;
	_tmp1_ = gee_priority_queue_offer (self, _tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gboolean gee_priority_queue_real_remove (GeeAbstractCollection* base, gconstpointer item) {
	GeePriorityQueue * self;
	gboolean result = FALSE;
	GeePriorityQueueIterator* iterator = NULL;
	GeePriorityQueueIterator* _tmp0_ = NULL;
	self = (GeePriorityQueue*) base;
	_tmp0_ = gee_priority_queue_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
	iterator = _tmp0_;
	while (TRUE) {
		GeePriorityQueueIterator* _tmp1_ = NULL;
		gboolean _tmp2_ = FALSE;
		gpointer an_item = NULL;
		GeePriorityQueueIterator* _tmp3_ = NULL;
		gpointer _tmp4_ = NULL;
		GCompareDataFunc _tmp5_ = NULL;
		void* _tmp5__target = NULL;
		GCompareDataFunc _tmp6_ = NULL;
		void* _tmp6__target = NULL;
		gconstpointer _tmp7_ = NULL;
		gconstpointer _tmp8_ = NULL;
		gint _tmp9_ = 0;
		_tmp1_ = iterator;
		_tmp2_ = gee_iterator_next ((GeeIterator*) _tmp1_);
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = iterator;
		_tmp4_ = gee_iterator_get ((GeeIterator*) _tmp3_);
		an_item = _tmp4_;
		_tmp5_ = gee_priority_queue_get_compare_func (self, &_tmp5__target);
		_tmp6_ = _tmp5_;
		_tmp6__target = _tmp5__target;
		_tmp7_ = item;
		_tmp8_ = an_item;
		_tmp9_ = _tmp6_ (_tmp7_, _tmp8_, _tmp6__target);
		if (_tmp9_ == 0) {
			GeePriorityQueueIterator* _tmp10_ = NULL;
			_tmp10_ = iterator;
			gee_iterator_remove ((GeeIterator*) _tmp10_);
			result = TRUE;
			((an_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (an_item = (self->priv->g_destroy_func (an_item), NULL));
			_g_object_unref0 (iterator);
			return result;
		}
		((an_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (an_item = (self->priv->g_destroy_func (an_item), NULL));
	}
	result = FALSE;
	_g_object_unref0 (iterator);
	return result;
}


/**
 * {@inheritDoc}
 */
static void gee_priority_queue_real_clear (GeeAbstractCollection* base) {
	GeePriorityQueue * self;
	GeePriorityQueueType1Node** _tmp0_ = NULL;
	gboolean* _tmp1_ = NULL;
	self = (GeePriorityQueue*) base;
	self->priv->_size = 0;
	_gee_priority_queue_node_unref0 (self->priv->_r);
	self->priv->_r = NULL;
	_gee_priority_queue_node_unref0 (self->priv->_r_prime);
	self->priv->_r_prime = NULL;
	_gee_priority_queue_node_unref0 (self->priv->_lm_head);
	self->priv->_lm_head = NULL;
	_gee_priority_queue_node_unref0 (self->priv->_lm_tail);
	self->priv->_lm_tail = NULL;
	_gee_priority_queue_node_unref0 (self->priv->_p);
	self->priv->_p = NULL;
	_tmp0_ = g_new0 (GeePriorityQueueType1Node*, 0 + 1);
	self->priv->_a = (_vala_array_free (self->priv->_a, self->priv->_a_length1, (GDestroyNotify) gee_priority_queue_node_unref), NULL);
	self->priv->_a = _tmp0_;
	self->priv->_a_length1 = 0;
	self->priv->__a_size_ = self->priv->_a_length1;
	_gee_priority_queue_node_pair_free0 (self->priv->_lp_head);
	self->priv->_lp_head = NULL;
	self->priv->_lp_tail = NULL;
	_tmp1_ = g_new0 (gboolean, 0);
	self->priv->_b = (g_free (self->priv->_b), NULL);
	self->priv->_b = _tmp1_;
	self->priv->_b_length1 = 0;
	self->priv->__b_size_ = self->priv->_b_length1;
	_gee_priority_queue_node_unref0 (self->priv->_ll_head);
	self->priv->_ll_head = NULL;
	_gee_priority_queue_node_unref0 (self->priv->_ll_tail);
	self->priv->_ll_tail = NULL;
	self->priv->_iter_head = NULL;
	self->priv->_iter_tail = NULL;
}


/**
 * {@inheritDoc}
 */
static GeeIterator* gee_priority_queue_real_iterator (GeeAbstractCollection* base) {
	GeePriorityQueue * self;
	GeeIterator* result = NULL;
	GeePriorityQueueIterator* _tmp0_ = NULL;
	self = (GeePriorityQueue*) base;
	_tmp0_ = gee_priority_queue_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
	result = (GeeIterator*) _tmp0_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gboolean gee_priority_queue_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) {
	GeePriorityQueue * self;
	gboolean result = FALSE;
	self = (GeePriorityQueue*) base;
	{
		GeePriorityQueueNode* current = NULL;
		GeePriorityQueueNode* _tmp0_ = NULL;
		_tmp0_ = self->priv->_iter_head;
		current = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GeePriorityQueueNode* _tmp4_ = NULL;
				GeeForallFunc _tmp5_ = NULL;
				void* _tmp5__target = NULL;
				GeePriorityQueueNode* _tmp6_ = NULL;
				gconstpointer _tmp7_ = NULL;
				gpointer _tmp8_ = NULL;
				gboolean _tmp9_ = FALSE;
				if (!_tmp1_) {
					GeePriorityQueueNode* _tmp2_ = NULL;
					GeePriorityQueueNode* _tmp3_ = NULL;
					_tmp2_ = current;
					_tmp3_ = _tmp2_->iter_next;
					current = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = current;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = f;
				_tmp5__target = f_target;
				_tmp6_ = current;
				_tmp7_ = _tmp6_->data;
				_tmp8_ = ((_tmp7_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp7_) : ((gpointer) _tmp7_);
				_tmp9_ = _tmp5_ (_tmp8_, _tmp5__target);
				if (!_tmp9_) {
					result = FALSE;
					return result;
				}
			}
		}
	}
	result = TRUE;
	return result;
}


static inline gint _gee_priority_queue_compare (GeePriorityQueue* self, GeePriorityQueueNode* node1, GeePriorityQueueNode* node2) {
	gint result = 0;
	GeePriorityQueueNode* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (node1 != NULL, 0);
	g_return_val_if_fail (node2 != NULL, 0);
	_tmp0_ = node1;
	_tmp1_ = _tmp0_->pending_drop;
	if (_tmp1_) {
		result = -1;
		return result;
	} else {
		GeePriorityQueueNode* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = node2;
		_tmp3_ = _tmp2_->pending_drop;
		if (_tmp3_) {
			result = 1;
			return result;
		} else {
			GCompareDataFunc _tmp4_ = NULL;
			void* _tmp4__target = NULL;
			GCompareDataFunc _tmp5_ = NULL;
			void* _tmp5__target = NULL;
			GeePriorityQueueNode* _tmp6_ = NULL;
			gconstpointer _tmp7_ = NULL;
			GeePriorityQueueNode* _tmp8_ = NULL;
			gconstpointer _tmp9_ = NULL;
			gint _tmp10_ = 0;
			_tmp4_ = gee_priority_queue_get_compare_func (self, &_tmp4__target);
			_tmp5_ = _tmp4_;
			_tmp5__target = _tmp4__target;
			_tmp6_ = node1;
			_tmp7_ = _tmp6_->data;
			_tmp8_ = node2;
			_tmp9_ = _tmp8_->data;
			_tmp10_ = _tmp5_ (_tmp7_, _tmp9_, _tmp5__target);
			result = _tmp10_;
			return result;
		}
	}
}


static inline void _gee_priority_queue_swap_data (GeePriorityQueue* self, GeePriorityQueueNode* node1, GeePriorityQueueNode* node2) {
	gpointer temp_data = NULL;
	GeePriorityQueueNode* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	gboolean temp_pending_drop = FALSE;
	GeePriorityQueueNode* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	GeePriorityQueueNode* _tmp4_ = NULL;
	GeePriorityQueueNode* _tmp5_ = NULL;
	gpointer _tmp6_ = NULL;
	GeePriorityQueueNode* _tmp7_ = NULL;
	GeePriorityQueueNode* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GeePriorityQueueNode* _tmp10_ = NULL;
	gpointer _tmp11_ = NULL;
	GeePriorityQueueNode* _tmp12_ = NULL;
	gboolean _tmp13_ = FALSE;
	GeePriorityQueueNode* _tmp14_ = NULL;
	GeePriorityQueueNode* _tmp15_ = NULL;
	GeePriorityQueueNode* _tmp16_ = NULL;
	GeePriorityQueueNode* _tmp58_ = NULL;
	GeePriorityQueueNode* _tmp59_ = NULL;
	GeePriorityQueueNode* _tmp64_ = NULL;
	GeePriorityQueueNode* _tmp65_ = NULL;
	GeePriorityQueueNode* _tmp70_ = NULL;
	GeePriorityQueueNode* _tmp71_ = NULL;
	GeePriorityQueueNode* _tmp75_ = NULL;
	GeePriorityQueueNode* _tmp76_ = NULL;
	GeePriorityQueueNode* _tmp80_ = NULL;
	GeePriorityQueueNode* _tmp81_ = NULL;
	GeePriorityQueueNode* _tmp85_ = NULL;
	GeePriorityQueueNode* _tmp86_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node1 != NULL);
	g_return_if_fail (node2 != NULL);
	_tmp0_ = node1;
	_tmp1_ = _tmp0_->data;
	_tmp0_->data = NULL;
	temp_data = _tmp1_;
	_tmp2_ = node1;
	_tmp3_ = _tmp2_->pending_drop;
	temp_pending_drop = _tmp3_;
	_tmp4_ = node1;
	_tmp5_ = node2;
	_tmp6_ = _tmp5_->data;
	_tmp5_->data = NULL;
	((_tmp4_->data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp4_->data = (self->priv->g_destroy_func (_tmp4_->data), NULL));
	_tmp4_->data = _tmp6_;
	_tmp7_ = node1;
	_tmp8_ = node2;
	_tmp9_ = _tmp8_->pending_drop;
	_tmp7_->pending_drop = _tmp9_;
	_tmp10_ = node2;
	_tmp11_ = temp_data;
	temp_data = NULL;
	((_tmp10_->data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp10_->data = (self->priv->g_destroy_func (_tmp10_->data), NULL));
	_tmp10_->data = _tmp11_;
	_tmp12_ = node2;
	_tmp13_ = temp_pending_drop;
	_tmp12_->pending_drop = _tmp13_;
	_tmp14_ = node1;
	_tmp15_ = _tmp14_->iter_next;
	_tmp16_ = node2;
	if (_tmp15_ == _tmp16_) {
		GeePriorityQueueNode* temp_iter_prev = NULL;
		GeePriorityQueueNode* _tmp17_ = NULL;
		GeePriorityQueueNode* _tmp18_ = NULL;
		GeePriorityQueueNode* temp_iter_next = NULL;
		GeePriorityQueueNode* _tmp19_ = NULL;
		GeePriorityQueueNode* _tmp20_ = NULL;
		GeePriorityQueueNode* _tmp21_ = NULL;
		GeePriorityQueueNode* _tmp22_ = NULL;
		GeePriorityQueueNode* _tmp23_ = NULL;
		GeePriorityQueueNode* _tmp24_ = NULL;
		GeePriorityQueueNode* _tmp25_ = NULL;
		GeePriorityQueueNode* _tmp26_ = NULL;
		GeePriorityQueueNode* _tmp27_ = NULL;
		GeePriorityQueueNode* _tmp28_ = NULL;
		_tmp17_ = node1;
		_tmp18_ = _tmp17_->iter_prev;
		temp_iter_prev = _tmp18_;
		_tmp19_ = node2;
		_tmp20_ = _tmp19_->iter_next;
		temp_iter_next = _tmp20_;
		_tmp21_ = node1;
		_tmp22_ = node2;
		_tmp21_->iter_prev = _tmp22_;
		_tmp23_ = node1;
		_tmp24_ = temp_iter_next;
		_tmp23_->iter_next = _tmp24_;
		_tmp25_ = node2;
		_tmp26_ = temp_iter_prev;
		_tmp25_->iter_prev = _tmp26_;
		_tmp27_ = node2;
		_tmp28_ = node1;
		_tmp27_->iter_next = _tmp28_;
	} else {
		GeePriorityQueueNode* _tmp29_ = NULL;
		GeePriorityQueueNode* _tmp30_ = NULL;
		GeePriorityQueueNode* _tmp31_ = NULL;
		_tmp29_ = node1;
		_tmp30_ = _tmp29_->iter_prev;
		_tmp31_ = node2;
		if (_tmp30_ == _tmp31_) {
			GeePriorityQueueNode* temp_iter_prev = NULL;
			GeePriorityQueueNode* _tmp32_ = NULL;
			GeePriorityQueueNode* _tmp33_ = NULL;
			GeePriorityQueueNode* temp_iter_next = NULL;
			GeePriorityQueueNode* _tmp34_ = NULL;
			GeePriorityQueueNode* _tmp35_ = NULL;
			GeePriorityQueueNode* _tmp36_ = NULL;
			GeePriorityQueueNode* _tmp37_ = NULL;
			GeePriorityQueueNode* _tmp38_ = NULL;
			GeePriorityQueueNode* _tmp39_ = NULL;
			GeePriorityQueueNode* _tmp40_ = NULL;
			GeePriorityQueueNode* _tmp41_ = NULL;
			GeePriorityQueueNode* _tmp42_ = NULL;
			GeePriorityQueueNode* _tmp43_ = NULL;
			_tmp32_ = node2;
			_tmp33_ = _tmp32_->iter_prev;
			temp_iter_prev = _tmp33_;
			_tmp34_ = node1;
			_tmp35_ = _tmp34_->iter_next;
			temp_iter_next = _tmp35_;
			_tmp36_ = node1;
			_tmp37_ = temp_iter_prev;
			_tmp36_->iter_prev = _tmp37_;
			_tmp38_ = node1;
			_tmp39_ = node2;
			_tmp38_->iter_next = _tmp39_;
			_tmp40_ = node2;
			_tmp41_ = node1;
			_tmp40_->iter_prev = _tmp41_;
			_tmp42_ = node2;
			_tmp43_ = temp_iter_next;
			_tmp42_->iter_next = _tmp43_;
		} else {
			GeePriorityQueueNode* temp_iter_prev = NULL;
			GeePriorityQueueNode* _tmp44_ = NULL;
			GeePriorityQueueNode* _tmp45_ = NULL;
			GeePriorityQueueNode* temp_iter_next = NULL;
			GeePriorityQueueNode* _tmp46_ = NULL;
			GeePriorityQueueNode* _tmp47_ = NULL;
			GeePriorityQueueNode* _tmp48_ = NULL;
			GeePriorityQueueNode* _tmp49_ = NULL;
			GeePriorityQueueNode* _tmp50_ = NULL;
			GeePriorityQueueNode* _tmp51_ = NULL;
			GeePriorityQueueNode* _tmp52_ = NULL;
			GeePriorityQueueNode* _tmp53_ = NULL;
			GeePriorityQueueNode* _tmp54_ = NULL;
			GeePriorityQueueNode* _tmp55_ = NULL;
			GeePriorityQueueNode* _tmp56_ = NULL;
			GeePriorityQueueNode* _tmp57_ = NULL;
			_tmp44_ = node1;
			_tmp45_ = _tmp44_->iter_prev;
			temp_iter_prev = _tmp45_;
			_tmp46_ = node1;
			_tmp47_ = _tmp46_->iter_next;
			temp_iter_next = _tmp47_;
			_tmp48_ = node1;
			_tmp49_ = node2;
			_tmp50_ = _tmp49_->iter_prev;
			_tmp48_->iter_prev = _tmp50_;
			_tmp51_ = node1;
			_tmp52_ = node2;
			_tmp53_ = _tmp52_->iter_next;
			_tmp51_->iter_next = _tmp53_;
			_tmp54_ = node2;
			_tmp55_ = temp_iter_prev;
			_tmp54_->iter_prev = _tmp55_;
			_tmp56_ = node2;
			_tmp57_ = temp_iter_next;
			_tmp56_->iter_next = _tmp57_;
		}
	}
	_tmp58_ = node2;
	_tmp59_ = self->priv->_iter_head;
	if (_tmp58_ == _tmp59_) {
		GeePriorityQueueNode* _tmp60_ = NULL;
		_tmp60_ = node1;
		self->priv->_iter_head = _tmp60_;
	} else {
		GeePriorityQueueNode* _tmp61_ = NULL;
		GeePriorityQueueNode* _tmp62_ = NULL;
		_tmp61_ = node1;
		_tmp62_ = self->priv->_iter_head;
		if (_tmp61_ == _tmp62_) {
			GeePriorityQueueNode* _tmp63_ = NULL;
			_tmp63_ = node2;
			self->priv->_iter_head = _tmp63_;
		}
	}
	_tmp64_ = node2;
	_tmp65_ = self->priv->_iter_tail;
	if (_tmp64_ == _tmp65_) {
		GeePriorityQueueNode* _tmp66_ = NULL;
		_tmp66_ = node1;
		self->priv->_iter_tail = _tmp66_;
	} else {
		GeePriorityQueueNode* _tmp67_ = NULL;
		GeePriorityQueueNode* _tmp68_ = NULL;
		_tmp67_ = node1;
		_tmp68_ = self->priv->_iter_tail;
		if (_tmp67_ == _tmp68_) {
			GeePriorityQueueNode* _tmp69_ = NULL;
			_tmp69_ = node2;
			self->priv->_iter_tail = _tmp69_;
		}
	}
	_tmp70_ = node1;
	_tmp71_ = _tmp70_->iter_prev;
	if (_tmp71_ != NULL) {
		GeePriorityQueueNode* _tmp72_ = NULL;
		GeePriorityQueueNode* _tmp73_ = NULL;
		GeePriorityQueueNode* _tmp74_ = NULL;
		_tmp72_ = node1;
		_tmp73_ = _tmp72_->iter_prev;
		_tmp74_ = node1;
		_tmp73_->iter_next = _tmp74_;
	}
	_tmp75_ = node1;
	_tmp76_ = _tmp75_->iter_next;
	if (_tmp76_ != NULL) {
		GeePriorityQueueNode* _tmp77_ = NULL;
		GeePriorityQueueNode* _tmp78_ = NULL;
		GeePriorityQueueNode* _tmp79_ = NULL;
		_tmp77_ = node1;
		_tmp78_ = _tmp77_->iter_next;
		_tmp79_ = node1;
		_tmp78_->iter_prev = _tmp79_;
	}
	_tmp80_ = node2;
	_tmp81_ = _tmp80_->iter_prev;
	if (_tmp81_ != NULL) {
		GeePriorityQueueNode* _tmp82_ = NULL;
		GeePriorityQueueNode* _tmp83_ = NULL;
		GeePriorityQueueNode* _tmp84_ = NULL;
		_tmp82_ = node2;
		_tmp83_ = _tmp82_->iter_prev;
		_tmp84_ = node2;
		_tmp83_->iter_next = _tmp84_;
	}
	_tmp85_ = node2;
	_tmp86_ = _tmp85_->iter_next;
	if (_tmp86_ != NULL) {
		GeePriorityQueueNode* _tmp87_ = NULL;
		GeePriorityQueueNode* _tmp88_ = NULL;
		GeePriorityQueueNode* _tmp89_ = NULL;
		_tmp87_ = node2;
		_tmp88_ = _tmp87_->iter_next;
		_tmp89_ = node2;
		_tmp88_->iter_prev = _tmp89_;
	}
	((temp_data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (temp_data = (self->priv->g_destroy_func (temp_data), NULL));
}


static inline void _gee_priority_queue_move_data (GeePriorityQueue* self, GeePriorityQueueNode* target, GeePriorityQueueNode* source) {
	GeePriorityQueueNode* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueNode* _tmp10_ = NULL;
	GeePriorityQueueNode* _tmp11_ = NULL;
	GeePriorityQueueNode* _tmp20_ = NULL;
	GeePriorityQueueNode* _tmp21_ = NULL;
	gconstpointer _tmp22_ = NULL;
	gpointer _tmp23_ = NULL;
	GeePriorityQueueNode* _tmp24_ = NULL;
	GeePriorityQueueNode* _tmp25_ = NULL;
	gboolean _tmp26_ = FALSE;
	GeePriorityQueueNode* _tmp27_ = NULL;
	GeePriorityQueueNode* _tmp28_ = NULL;
	GeePriorityQueueNode* _tmp29_ = NULL;
	GeePriorityQueueNode* _tmp30_ = NULL;
	GeePriorityQueueNode* _tmp31_ = NULL;
	GeePriorityQueueNode* _tmp32_ = NULL;
	GeePriorityQueueNode* _tmp33_ = NULL;
	GeePriorityQueueNode* _tmp34_ = NULL;
	GeePriorityQueueNode* _tmp35_ = NULL;
	GeePriorityQueueNode* _tmp36_ = NULL;
	GeePriorityQueueNode* _tmp43_ = NULL;
	GeePriorityQueueNode* _tmp44_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = target;
	_tmp1_ = _tmp0_->iter_next;
	if (_tmp1_ != NULL) {
		GeePriorityQueueNode* _tmp2_ = NULL;
		GeePriorityQueueNode* _tmp3_ = NULL;
		GeePriorityQueueNode* _tmp4_ = NULL;
		GeePriorityQueueNode* _tmp5_ = NULL;
		_tmp2_ = target;
		_tmp3_ = _tmp2_->iter_next;
		_tmp4_ = target;
		_tmp5_ = _tmp4_->iter_prev;
		_tmp3_->iter_prev = _tmp5_;
	} else {
		GeePriorityQueueNode* _tmp6_ = NULL;
		GeePriorityQueueNode* _tmp7_ = NULL;
		_tmp6_ = self->priv->_iter_tail;
		_tmp7_ = target;
		if (_tmp6_ == _tmp7_) {
			GeePriorityQueueNode* _tmp8_ = NULL;
			GeePriorityQueueNode* _tmp9_ = NULL;
			_tmp8_ = target;
			_tmp9_ = _tmp8_->iter_prev;
			self->priv->_iter_tail = _tmp9_;
		}
	}
	_tmp10_ = target;
	_tmp11_ = _tmp10_->iter_prev;
	if (_tmp11_ != NULL) {
		GeePriorityQueueNode* _tmp12_ = NULL;
		GeePriorityQueueNode* _tmp13_ = NULL;
		GeePriorityQueueNode* _tmp14_ = NULL;
		GeePriorityQueueNode* _tmp15_ = NULL;
		_tmp12_ = target;
		_tmp13_ = _tmp12_->iter_prev;
		_tmp14_ = target;
		_tmp15_ = _tmp14_->iter_next;
		_tmp13_->iter_next = _tmp15_;
	} else {
		GeePriorityQueueNode* _tmp16_ = NULL;
		GeePriorityQueueNode* _tmp17_ = NULL;
		_tmp16_ = self->priv->_iter_head;
		_tmp17_ = target;
		if (_tmp16_ == _tmp17_) {
			GeePriorityQueueNode* _tmp18_ = NULL;
			GeePriorityQueueNode* _tmp19_ = NULL;
			_tmp18_ = target;
			_tmp19_ = _tmp18_->iter_next;
			self->priv->_iter_head = _tmp19_;
		}
	}
	_tmp20_ = target;
	_tmp21_ = source;
	_tmp22_ = _tmp21_->data;
	_tmp23_ = ((_tmp22_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp22_) : ((gpointer) _tmp22_);
	((_tmp20_->data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp20_->data = (self->priv->g_destroy_func (_tmp20_->data), NULL));
	_tmp20_->data = _tmp23_;
	_tmp24_ = target;
	_tmp25_ = source;
	_tmp26_ = _tmp25_->pending_drop;
	_tmp24_->pending_drop = _tmp26_;
	_tmp27_ = target;
	_tmp28_ = source;
	_tmp29_ = _tmp28_->iter_next;
	_tmp27_->iter_next = _tmp29_;
	_tmp30_ = target;
	_tmp31_ = source;
	_tmp32_ = _tmp31_->iter_prev;
	_tmp30_->iter_prev = _tmp32_;
	_tmp33_ = source;
	_tmp33_->iter_next = NULL;
	_tmp34_ = source;
	_tmp34_->iter_prev = NULL;
	_tmp35_ = target;
	_tmp36_ = _tmp35_->iter_next;
	if (_tmp36_ != NULL) {
		GeePriorityQueueNode* _tmp37_ = NULL;
		GeePriorityQueueNode* _tmp38_ = NULL;
		GeePriorityQueueNode* _tmp39_ = NULL;
		_tmp37_ = target;
		_tmp38_ = _tmp37_->iter_next;
		_tmp39_ = target;
		_tmp38_->iter_prev = _tmp39_;
	} else {
		GeePriorityQueueNode* _tmp40_ = NULL;
		GeePriorityQueueNode* _tmp41_ = NULL;
		_tmp40_ = self->priv->_iter_tail;
		_tmp41_ = source;
		if (_tmp40_ == _tmp41_) {
			GeePriorityQueueNode* _tmp42_ = NULL;
			_tmp42_ = target;
			self->priv->_iter_tail = _tmp42_;
		}
	}
	_tmp43_ = target;
	_tmp44_ = _tmp43_->iter_prev;
	if (_tmp44_ != NULL) {
		GeePriorityQueueNode* _tmp45_ = NULL;
		GeePriorityQueueNode* _tmp46_ = NULL;
		GeePriorityQueueNode* _tmp47_ = NULL;
		_tmp45_ = target;
		_tmp46_ = _tmp45_->iter_prev;
		_tmp47_ = target;
		_tmp46_->iter_next = _tmp47_;
	} else {
		GeePriorityQueueNode* _tmp48_ = NULL;
		GeePriorityQueueNode* _tmp49_ = NULL;
		_tmp48_ = self->priv->_iter_head;
		_tmp49_ = source;
		if (_tmp48_ == _tmp49_) {
			GeePriorityQueueNode* _tmp50_ = NULL;
			_tmp50_ = target;
			self->priv->_iter_head = _tmp50_;
		}
	}
}


static void _gee_priority_queue_link (GeePriorityQueue* self, GeePriorityQueueType1Node* ri, GeePriorityQueueType1Node* rj) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	GeePriorityQueueType1Node* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GeePriorityQueueType1Node* _tmp4_ = NULL;
	GeePriorityQueueType1Node* _tmp5_ = NULL;
	GeePriorityQueueType1Node* _tmp6_ = NULL;
	GeePriorityQueueType1Node* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	GeePriorityQueueType1Node* _tmp15_ = NULL;
	GeePriorityQueueType1Node* _tmp16_ = NULL;
	GeePriorityQueueType1Node* _tmp17_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ri != NULL);
	g_return_if_fail (rj != NULL);
	_tmp0_ = ri;
	_tmp1_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp0_);
	_tmp2_ = rj;
	_tmp3_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp2_);
	_vala_assert (_tmp1_ == _tmp3_, "ri.degree () == rj.degree ()");
	_tmp4_ = ri;
	_gee_priority_queue_remove_type1_node (self, _tmp4_, FALSE);
	_tmp5_ = rj;
	_gee_priority_queue_remove_type1_node (self, _tmp5_, FALSE);
	_tmp6_ = ri;
	_tmp7_ = rj;
	_tmp8_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp6_, (GeePriorityQueueNode*) _tmp7_);
	if (_tmp8_ > 0) {
		GeePriorityQueueType1Node* temp = NULL;
		GeePriorityQueueType1Node* _tmp9_ = NULL;
		GeePriorityQueueType1Node* _tmp10_ = NULL;
		GeePriorityQueueType1Node* _tmp11_ = NULL;
		GeePriorityQueueType1Node* _tmp12_ = NULL;
		GeePriorityQueueType1Node* _tmp13_ = NULL;
		GeePriorityQueueType1Node* _tmp14_ = NULL;
		_tmp9_ = ri;
		_tmp10_ = _gee_priority_queue_node_ref0 (_tmp9_);
		temp = _tmp10_;
		_tmp11_ = rj;
		_tmp12_ = _gee_priority_queue_node_ref0 (_tmp11_);
		_gee_priority_queue_node_unref0 (ri);
		ri = _tmp12_;
		_tmp13_ = temp;
		_tmp14_ = _gee_priority_queue_node_ref0 (_tmp13_);
		_gee_priority_queue_node_unref0 (rj);
		rj = _tmp14_;
		_gee_priority_queue_node_unref0 (temp);
	}
	_tmp15_ = rj;
	_tmp16_ = ri;
	_gee_priority_queue_add_to (self, _tmp15_, _tmp16_);
	_tmp17_ = ri;
	_gee_priority_queue_add_in_r_prime (self, _tmp17_);
	_gee_priority_queue_node_unref0 (ri);
	_gee_priority_queue_node_unref0 (rj);
}


static void _gee_priority_queue_add (GeePriorityQueue* self, GeePriorityQueueType1Node* n) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	GeePriorityQueueType2Node* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GeePriorityQueueType2Node* _tmp6_ = NULL;
	GeePriorityQueueType1Node* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (n != NULL);
	_tmp0_ = n;
	_gee_priority_queue_add_in_r_prime (self, _tmp0_);
	_tmp1_ = n;
	_tmp2_ = self->priv->_r_prime;
	_tmp3_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp1_, (GeePriorityQueueNode*) _tmp2_);
	if (_tmp3_ < 0) {
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		GeePriorityQueueType2Node* _tmp5_ = NULL;
		_tmp4_ = n;
		_tmp5_ = self->priv->_r_prime;
		_gee_priority_queue_swap_data (self, (GeePriorityQueueNode*) _tmp4_, (GeePriorityQueueNode*) _tmp5_);
	}
	_tmp6_ = self->priv->_r_prime;
	_tmp7_ = self->priv->_r;
	_tmp8_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp6_, (GeePriorityQueueNode*) _tmp7_);
	if (_tmp8_ < 0) {
		GeePriorityQueueType2Node* _tmp9_ = NULL;
		GeePriorityQueueType1Node* _tmp10_ = NULL;
		_tmp9_ = self->priv->_r_prime;
		_tmp10_ = self->priv->_r;
		_gee_priority_queue_swap_data (self, (GeePriorityQueueNode*) _tmp9_, (GeePriorityQueueNode*) _tmp10_);
	}
	_gee_priority_queue_check_linkable (self);
}


static gboolean _gee_priority_queue_check_linkable (GeePriorityQueue* self) {
	gboolean result = FALSE;
	GeePriorityQueueNodePair* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_lp_head;
	if (_tmp0_ != NULL) {
		GeePriorityQueueNodePair* pair = NULL;
		GeePriorityQueueNodePair* _tmp1_ = NULL;
		GeePriorityQueueNodePair* _tmp2_ = NULL;
		GeePriorityQueueType1Node* _tmp3_ = NULL;
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		GeePriorityQueueNodePair* _tmp5_ = NULL;
		GeePriorityQueueType1Node* _tmp6_ = NULL;
		GeePriorityQueueType1Node* _tmp7_ = NULL;
		_tmp1_ = self->priv->_lp_head;
		pair = _tmp1_;
		_tmp2_ = pair;
		_tmp3_ = _tmp2_->node1;
		_tmp4_ = _gee_priority_queue_node_ref0 (_tmp3_);
		_tmp5_ = pair;
		_tmp6_ = _tmp5_->node2;
		_tmp7_ = _gee_priority_queue_node_ref0 (_tmp6_);
		_gee_priority_queue_link (self, _tmp4_, _tmp7_);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static GeePriorityQueueNode* _gee_priority_queue_re_insert (GeePriorityQueue* self, GeePriorityQueueType1Node* n) {
	GeePriorityQueueNode* result = NULL;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	GeePriorityQueueNode* parent = NULL;
	GeePriorityQueueType1Node* _tmp2_ = NULL;
	GeePriorityQueueNode* _tmp3_ = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	GeePriorityQueueType1Node* _tmp5_ = NULL;
	GeePriorityQueueType1Node* _tmp6_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (n != NULL, NULL);
	_tmp0_ = n;
	_tmp1_ = self->priv->_r;
	_vala_assert (_tmp0_ != _tmp1_, "n != _r");
	_tmp2_ = n;
	_tmp3_ = ((GeePriorityQueueNode*) _tmp2_)->parent;
	_tmp4_ = _gee_priority_queue_node_ref0 (_tmp3_);
	parent = _tmp4_;
	_tmp5_ = n;
	_gee_priority_queue_remove_type1_node (self, _tmp5_, FALSE);
	_tmp6_ = n;
	_gee_priority_queue_add (self, _tmp6_);
	result = parent;
	_gee_priority_queue_node_unref0 (n);
	return result;
}


static void _gee_priority_queue_adjust (GeePriorityQueue* self, GeePriorityQueueType1Node* p1, GeePriorityQueueType1Node* p2) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* m = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	GeePriorityQueueType1Node* _tmp3_ = NULL;
	guint _tmp4_ = 0U;
	GeePriorityQueueType1Node* _tmp9_ = NULL;
	guint _tmp10_ = 0U;
	GeePriorityQueueType1Node* _tmp20_ = NULL;
	GeePriorityQueueType1Node* _tmp21_ = NULL;
	GeePriorityQueueNode* _tmp22_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p1 != NULL);
	g_return_if_fail (p2 != NULL);
	_tmp0_ = self->priv->_ll_head;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = p1;
	_tmp2_ = _tmp1_->lost;
	_tmp3_ = p2;
	_tmp4_ = _tmp3_->lost;
	if (_tmp2_ > _tmp4_) {
		GeePriorityQueueType1Node* _tmp5_ = NULL;
		GeePriorityQueueType1Node* _tmp6_ = NULL;
		_tmp5_ = p1;
		_tmp6_ = _gee_priority_queue_node_ref0 (_tmp5_);
		_gee_priority_queue_node_unref0 (m);
		m = _tmp6_;
	} else {
		GeePriorityQueueType1Node* _tmp7_ = NULL;
		GeePriorityQueueType1Node* _tmp8_ = NULL;
		_tmp7_ = p2;
		_tmp8_ = _gee_priority_queue_node_ref0 (_tmp7_);
		_gee_priority_queue_node_unref0 (m);
		m = _tmp8_;
	}
	_tmp9_ = m;
	_tmp10_ = _tmp9_->lost;
	if (_tmp10_ <= ((guint) 1)) {
		GeePriorityQueueType1Node* _tmp11_ = NULL;
		GeePriorityQueueType1Node* _tmp12_ = NULL;
		GeePriorityQueueType1Node* _tmp13_ = NULL;
		GeePriorityQueueType1Node* _tmp14_ = NULL;
		GeePriorityQueueType1Node* _tmp17_ = NULL;
		GeePriorityQueueType1Node* _tmp18_ = NULL;
		GeePriorityQueueType1Node* _tmp19_ = NULL;
		_tmp11_ = self->priv->_ll_head;
		_tmp12_ = _gee_priority_queue_node_ref0 (_tmp11_);
		_gee_priority_queue_node_unref0 (m);
		m = _tmp12_;
		_tmp13_ = self->priv->_ll_head;
		_tmp14_ = _tmp13_->ll_next;
		if (_tmp14_ != NULL) {
			GeePriorityQueueType1Node* _tmp15_ = NULL;
			GeePriorityQueueType1Node* _tmp16_ = NULL;
			_tmp15_ = self->priv->_ll_head;
			_tmp16_ = _tmp15_->ll_next;
			_tmp16_->ll_prev = NULL;
		}
		_tmp17_ = self->priv->_ll_head;
		_tmp18_ = _tmp17_->ll_next;
		_tmp19_ = _gee_priority_queue_node_ref0 (_tmp18_);
		_gee_priority_queue_node_unref0 (self->priv->_ll_head);
		self->priv->_ll_head = _tmp19_;
	}
	_tmp20_ = m;
	_tmp21_ = _gee_priority_queue_node_ref0 (_tmp20_);
	_tmp22_ = _gee_priority_queue_re_insert (self, _tmp21_);
	_gee_priority_queue_node_unref0 (self->priv->_p);
	self->priv->_p = G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node);
	_gee_priority_queue_node_unref0 (m);
}


static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n) {
	GeePriorityQueueNode* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (n != NULL);
	_tmp0_ = n;
	_gee_priority_queue_decrease_key (self, _tmp0_);
	_tmp1_ = gee_abstract_queue_poll ((GeeAbstractQueue*) self);
	_tmp2_ = _tmp1_;
	((_tmp2_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->g_destroy_func (_tmp2_), NULL));
}


static void _gee_priority_queue_decrease_key (GeePriorityQueue* self, GeePriorityQueueNode* n) {
	gboolean _tmp0_ = FALSE;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueType1Node* _tmp2_ = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GeePriorityQueueNode* _tmp6_ = NULL;
	GeePriorityQueueType2Node* _tmp7_ = NULL;
	GeePriorityQueueNode* p_prime = NULL;
	GeePriorityQueueNode* _tmp13_ = NULL;
	GeePriorityQueueType1Node* _tmp14_ = NULL;
	GeePriorityQueueNode* _tmp15_ = NULL;
	GeePriorityQueueNode* _tmp16_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (n != NULL);
	_tmp1_ = n;
	_tmp2_ = self->priv->_r;
	if (_tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
		_tmp0_ = TRUE;
	} else {
		GeePriorityQueueType2Node* _tmp3_ = NULL;
		_tmp3_ = self->priv->_r_prime;
		_tmp0_ = _tmp3_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp4_ = n;
	_tmp4_->pending_drop = TRUE;
	_tmp6_ = n;
	_tmp7_ = self->priv->_r_prime;
	if (_tmp6_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
		GeePriorityQueueType2Node* _tmp8_ = NULL;
		GeePriorityQueueType1Node* _tmp9_ = NULL;
		gint _tmp10_ = 0;
		_tmp8_ = self->priv->_r_prime;
		_tmp9_ = self->priv->_r;
		_tmp10_ = _gee_priority_queue_compare (self, (GeePriorityQueueNode*) _tmp8_, (GeePriorityQueueNode*) _tmp9_);
		_tmp5_ = _tmp10_ < 0;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GeePriorityQueueType2Node* _tmp11_ = NULL;
		GeePriorityQueueType1Node* _tmp12_ = NULL;
		_tmp11_ = self->priv->_r_prime;
		_tmp12_ = self->priv->_r;
		_gee_priority_queue_swap_data (self, (GeePriorityQueueNode*) _tmp11_, (GeePriorityQueueNode*) _tmp12_);
		return;
	}
	_tmp13_ = n;
	_tmp14_ = _gee_priority_queue_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node));
	_tmp15_ = _gee_priority_queue_re_insert (self, _tmp14_);
	p_prime = _tmp15_;
	_tmp16_ = p_prime;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE)) {
		GeePriorityQueueType1Node* _tmp17_ = NULL;
		GeePriorityQueueType1Node* _tmp18_ = NULL;
		_tmp17_ = self->priv->_p;
		_tmp18_ = self->priv->_p;
		_gee_priority_queue_adjust (self, _tmp17_, _tmp18_);
	} else {
		GeePriorityQueueType1Node* _tmp19_ = NULL;
		GeePriorityQueueNode* _tmp20_ = NULL;
		_tmp19_ = self->priv->_p;
		_tmp20_ = p_prime;
		_gee_priority_queue_adjust (self, _tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node));
	}
	_gee_priority_queue_node_unref0 (p_prime);
}


static void _gee_priority_queue_add_to (GeePriorityQueue* self, GeePriorityQueueType1Node* node, GeePriorityQueueType1Node* parent) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	GeePriorityQueueType1Node* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (parent != NULL);
	_tmp0_ = parent;
	_tmp1_ = node;
	gee_priority_queue_type1_node_add (_tmp0_, _tmp1_);
	_tmp2_ = parent;
	_tmp2_->lost = (guint) 0;
}


static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePriorityQueueType1Node* node) {
	gint degree = 0;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	GeePriorityQueueType1Node* insertion_point = NULL;
	gint _tmp2_ = 0;
	GeePriorityQueueType1Node** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	GeePriorityQueueType1Node* _tmp8_ = NULL;
	GeePriorityQueueType1Node* _tmp41_ = NULL;
	GeePriorityQueueType2Node* _tmp42_ = NULL;
	gint _tmp43_ = 0;
	GeePriorityQueueType1Node** _tmp44_ = NULL;
	gint _tmp44__length1 = 0;
	GeePriorityQueueType1Node** _tmp49_ = NULL;
	gint _tmp49__length1 = 0;
	gint _tmp50_ = 0;
	GeePriorityQueueType1Node* _tmp51_ = NULL;
	GeePriorityQueueType1Node** _tmp82_ = NULL;
	gint _tmp82__length1 = 0;
	gint _tmp83_ = 0;
	GeePriorityQueueType1Node* _tmp84_ = NULL;
	GeePriorityQueueType1Node* _tmp85_ = NULL;
	GeePriorityQueueType1Node* _tmp86_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	_tmp1_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp0_);
	degree = _tmp1_;
	insertion_point = NULL;
	_tmp2_ = degree;
	_tmp3_ = self->priv->_a;
	_tmp3__length1 = self->priv->_a_length1;
	if (_tmp2_ < _tmp3__length1) {
		GeePriorityQueueType1Node** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		gint _tmp5_ = 0;
		GeePriorityQueueType1Node* _tmp6_ = NULL;
		GeePriorityQueueType1Node* _tmp7_ = NULL;
		_tmp4_ = self->priv->_a;
		_tmp4__length1 = self->priv->_a_length1;
		_tmp5_ = degree;
		_tmp6_ = _tmp4_[_tmp5_];
		_tmp7_ = _gee_priority_queue_node_ref0 (_tmp6_);
		_gee_priority_queue_node_unref0 (insertion_point);
		insertion_point = _tmp7_;
	}
	_tmp8_ = insertion_point;
	if (_tmp8_ == NULL) {
		GeePriorityQueueType2Node* _tmp9_ = NULL;
		GeePriorityQueueType1Node* _tmp10_ = NULL;
		GeePriorityQueueType2Node* _tmp21_ = NULL;
		GeePriorityQueueType1Node* _tmp22_ = NULL;
		GeePriorityQueueType1Node* _tmp23_ = NULL;
		_tmp9_ = self->priv->_r_prime;
		_tmp10_ = ((GeePriorityQueueNode*) _tmp9_)->type1_children_tail;
		if (_tmp10_ != NULL) {
			GeePriorityQueueType1Node* _tmp11_ = NULL;
			GeePriorityQueueType2Node* _tmp12_ = NULL;
			GeePriorityQueueType1Node* _tmp13_ = NULL;
			GeePriorityQueueType2Node* _tmp14_ = NULL;
			GeePriorityQueueType1Node* _tmp15_ = NULL;
			GeePriorityQueueType1Node* _tmp16_ = NULL;
			GeePriorityQueueType1Node* _tmp17_ = NULL;
			_tmp11_ = node;
			_tmp12_ = self->priv->_r_prime;
			_tmp13_ = ((GeePriorityQueueNode*) _tmp12_)->type1_children_tail;
			_tmp11_->brothers_prev = _tmp13_;
			_tmp14_ = self->priv->_r_prime;
			_tmp15_ = ((GeePriorityQueueNode*) _tmp14_)->type1_children_tail;
			_tmp16_ = node;
			_tmp17_ = _gee_priority_queue_node_ref0 (_tmp16_);
			_gee_priority_queue_node_unref0 (_tmp15_->brothers_next);
			_tmp15_->brothers_next = _tmp17_;
		} else {
			GeePriorityQueueType2Node* _tmp18_ = NULL;
			GeePriorityQueueType1Node* _tmp19_ = NULL;
			GeePriorityQueueType1Node* _tmp20_ = NULL;
			_tmp18_ = self->priv->_r_prime;
			_tmp19_ = node;
			_tmp20_ = _gee_priority_queue_node_ref0 (_tmp19_);
			_gee_priority_queue_node_unref0 (((GeePriorityQueueNode*) _tmp18_)->type1_children_head);
			((GeePriorityQueueNode*) _tmp18_)->type1_children_head = _tmp20_;
		}
		_tmp21_ = self->priv->_r_prime;
		_tmp22_ = node;
		_tmp23_ = _gee_priority_queue_node_ref0 (_tmp22_);
		_gee_priority_queue_node_unref0 (((GeePriorityQueueNode*) _tmp21_)->type1_children_tail);
		((GeePriorityQueueNode*) _tmp21_)->type1_children_tail = _tmp23_;
	} else {
		GeePriorityQueueType1Node* _tmp24_ = NULL;
		GeePriorityQueueType1Node* _tmp25_ = NULL;
		GeePriorityQueueType1Node* _tmp36_ = NULL;
		GeePriorityQueueType1Node* _tmp37_ = NULL;
		GeePriorityQueueType1Node* _tmp38_ = NULL;
		GeePriorityQueueType1Node* _tmp39_ = NULL;
		GeePriorityQueueType1Node* _tmp40_ = NULL;
		_tmp24_ = insertion_point;
		_tmp25_ = _tmp24_->brothers_prev;
		if (_tmp25_ != NULL) {
			GeePriorityQueueType1Node* _tmp26_ = NULL;
			GeePriorityQueueType1Node* _tmp27_ = NULL;
			GeePriorityQueueType1Node* _tmp28_ = NULL;
			GeePriorityQueueType1Node* _tmp29_ = NULL;
			GeePriorityQueueType1Node* _tmp30_ = NULL;
			GeePriorityQueueType1Node* _tmp31_ = NULL;
			GeePriorityQueueType1Node* _tmp32_ = NULL;
			_tmp26_ = insertion_point;
			_tmp27_ = _tmp26_->brothers_prev;
			_tmp28_ = node;
			_tmp29_ = _gee_priority_queue_node_ref0 (_tmp28_);
			_gee_priority_queue_node_unref0 (_tmp27_->brothers_next);
			_tmp27_->brothers_next = _tmp29_;
			_tmp30_ = node;
			_tmp31_ = insertion_point;
			_tmp32_ = _tmp31_->brothers_prev;
			_tmp30_->brothers_prev = _tmp32_;
		} else {
			GeePriorityQueueType2Node* _tmp33_ = NULL;
			GeePriorityQueueType1Node* _tmp34_ = NULL;
			GeePriorityQueueType1Node* _tmp35_ = NULL;
			_tmp33_ = self->priv->_r_prime;
			_tmp34_ = node;
			_tmp35_ = _gee_priority_queue_node_ref0 (_tmp34_);
			_gee_priority_queue_node_unref0 (((GeePriorityQueueNode*) _tmp33_)->type1_children_head);
			((GeePriorityQueueNode*) _tmp33_)->type1_children_head = _tmp35_;
		}
		_tmp36_ = node;
		_tmp37_ = insertion_point;
		_tmp38_ = _gee_priority_queue_node_ref0 (_tmp37_);
		_gee_priority_queue_node_unref0 (_tmp36_->brothers_next);
		_tmp36_->brothers_next = _tmp38_;
		_tmp39_ = insertion_point;
		_tmp40_ = node;
		_tmp39_->brothers_prev = _tmp40_;
	}
	_tmp41_ = node;
	_tmp42_ = self->priv->_r_prime;
	((GeePriorityQueueNode*) _tmp41_)->parent = (GeePriorityQueueNode*) _tmp42_;
	_tmp43_ = degree;
	_tmp44_ = self->priv->_a;
	_tmp44__length1 = self->priv->_a_length1;
	if (_tmp43_ >= _tmp44__length1) {
		gint _tmp45_ = 0;
		gint _tmp46_ = 0;
		gint _tmp47_ = 0;
		gint _tmp48_ = 0;
		_tmp45_ = degree;
		_tmp46_ = _tmp45_ + 1;
		self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp45_ + 1);
		(_tmp46_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp46_ - self->priv->_a_length1)) : NULL;
		self->priv->_a_length1 = _tmp46_;
		self->priv->__a_size_ = _tmp46_;
		_tmp47_ = degree;
		_tmp48_ = _tmp47_ + 1;
		self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp47_ + 1);
		(_tmp48_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp48_ - self->priv->_b_length1)) : NULL;
		self->priv->_b_length1 = _tmp48_;
		self->priv->__b_size_ = _tmp48_;
	}
	_tmp49_ = self->priv->_a;
	_tmp49__length1 = self->priv->_a_length1;
	_tmp50_ = degree;
	_tmp51_ = _tmp49_[_tmp50_];
	if (_tmp51_ == NULL) {
		gboolean* _tmp52_ = NULL;
		gint _tmp52__length1 = 0;
		gint _tmp53_ = 0;
		gboolean _tmp54_ = FALSE;
		_tmp52_ = self->priv->_b;
		_tmp52__length1 = self->priv->_b_length1;
		_tmp53_ = degree;
		_tmp52_[_tmp53_] = TRUE;
		_tmp54_ = _tmp52_[_tmp53_];
	} else {
		gboolean* _tmp55_ = NULL;
		gint _tmp55__length1 = 0;
		gint _tmp56_ = 0;
		gboolean _tmp57_ = FALSE;
		_tmp55_ = self->priv->_b;
		_tmp55__length1 = self->priv->_b_length1;
		_tmp56_ = degree;
		_tmp57_ = _tmp55_[_tmp56_];
		if (_tmp57_) {
			GeePriorityQueueNodePair* pair = NULL;
			GeePriorityQueueType1Node* _tmp58_ = NULL;
			GeePriorityQueueType1Node* _tmp59_ = NULL;
			GeePriorityQueueType1Node* _tmp60_ = NULL;
			GeePriorityQueueNodePair* _tmp61_ = NULL;
			GeePriorityQueueType1Node* _tmp62_ = NULL;
			GeePriorityQueueType1Node* _tmp63_ = NULL;
			GeePriorityQueueNodePair* _tmp64_ = NULL;
			GeePriorityQueueType1Node* _tmp65_ = NULL;
			GeePriorityQueueNodePair* _tmp66_ = NULL;
			GeePriorityQueueNodePair* _tmp67_ = NULL;
			gboolean* _tmp76_ = NULL;
			gint _tmp76__length1 = 0;
			gint _tmp77_ = 0;
			gboolean _tmp78_ = FALSE;
			_tmp58_ = node;
			_tmp59_ = node;
			_tmp60_ = _tmp59_->brothers_next;
			_tmp61_ = gee_priority_queue_node_pair_new (_tmp58_, _tmp60_);
			pair = _tmp61_;
			_tmp62_ = node;
			_tmp63_ = _tmp62_->brothers_next;
			_tmp64_ = pair;
			_tmp63_->pair = _tmp64_;
			_tmp65_ = node;
			_tmp66_ = pair;
			_tmp65_->pair = _tmp66_;
			_tmp67_ = self->priv->_lp_head;
			if (_tmp67_ == NULL) {
				GeePriorityQueueNodePair* _tmp68_ = NULL;
				GeePriorityQueueNodePair* _tmp69_ = NULL;
				_tmp68_ = pair;
				self->priv->_lp_tail = _tmp68_;
				_tmp69_ = pair;
				pair = NULL;
				_gee_priority_queue_node_pair_free0 (self->priv->_lp_head);
				self->priv->_lp_head = _tmp69_;
			} else {
				GeePriorityQueueNodePair* _tmp70_ = NULL;
				GeePriorityQueueNodePair* _tmp71_ = NULL;
				GeePriorityQueueNodePair* _tmp72_ = NULL;
				GeePriorityQueueNodePair* _tmp73_ = NULL;
				GeePriorityQueueNodePair* _tmp74_ = NULL;
				GeePriorityQueueNodePair* _tmp75_ = NULL;
				_tmp70_ = pair;
				_tmp71_ = self->priv->_lp_tail;
				_tmp70_->lp_prev = _tmp71_;
				_tmp72_ = self->priv->_lp_tail;
				_tmp73_ = pair;
				pair = NULL;
				_gee_priority_queue_node_pair_free0 (_tmp72_->lp_next);
				_tmp72_->lp_next = _tmp73_;
				_tmp74_ = self->priv->_lp_tail;
				_tmp75_ = _tmp74_->lp_next;
				self->priv->_lp_tail = _tmp75_;
			}
			_tmp76_ = self->priv->_b;
			_tmp76__length1 = self->priv->_b_length1;
			_tmp77_ = degree;
			_tmp76_[_tmp77_] = FALSE;
			_tmp78_ = _tmp76_[_tmp77_];
			_gee_priority_queue_node_pair_free0 (pair);
		} else {
			gboolean* _tmp79_ = NULL;
			gint _tmp79__length1 = 0;
			gint _tmp80_ = 0;
			gboolean _tmp81_ = FALSE;
			_tmp79_ = self->priv->_b;
			_tmp79__length1 = self->priv->_b_length1;
			_tmp80_ = degree;
			_tmp79_[_tmp80_] = TRUE;
			_tmp81_ = _tmp79_[_tmp80_];
		}
	}
	_tmp82_ = self->priv->_a;
	_tmp82__length1 = self->priv->_a_length1;
	_tmp83_ = degree;
	_tmp84_ = node;
	_tmp85_ = _gee_priority_queue_node_ref0 (_tmp84_);
	_gee_priority_queue_node_unref0 (_tmp82_[_tmp83_]);
	_tmp82_[_tmp83_] = _tmp85_;
	_tmp86_ = _tmp82_[_tmp83_];
	_gee_priority_queue_node_unref0 (insertion_point);
}


static void _gee_priority_queue_remove_type1_node (GeePriorityQueue* self, GeePriorityQueueType1Node* node, gboolean with_iteration) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueType2Node* _tmp2_ = NULL;
	GeePriorityQueueType1Node* _tmp55_ = NULL;
	GeePriorityQueueType1Node* _tmp56_ = NULL;
	GeePriorityQueueType1Node* _tmp59_ = NULL;
	gboolean _tmp60_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	_tmp1_ = ((GeePriorityQueueNode*) _tmp0_)->parent;
	_tmp2_ = self->priv->_r_prime;
	if (_tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
		GeePriorityQueueType1Node* _tmp3_ = NULL;
		_tmp3_ = node;
		_gee_priority_queue_updated_degree (self, _tmp3_, FALSE);
	} else {
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		GeePriorityQueueType1Node* _tmp5_ = NULL;
		GeePriorityQueueType1Node* _tmp16_ = NULL;
		GeePriorityQueueType1Node* _tmp17_ = NULL;
		GeePriorityQueueType1Node* _tmp27_ = NULL;
		GeePriorityQueueNode* _tmp28_ = NULL;
		_tmp4_ = node;
		_tmp5_ = _tmp4_->ll_prev;
		if (_tmp5_ != NULL) {
			GeePriorityQueueType1Node* _tmp6_ = NULL;
			GeePriorityQueueType1Node* _tmp7_ = NULL;
			GeePriorityQueueType1Node* _tmp8_ = NULL;
			GeePriorityQueueType1Node* _tmp9_ = NULL;
			GeePriorityQueueType1Node* _tmp10_ = NULL;
			_tmp6_ = node;
			_tmp7_ = _tmp6_->ll_prev;
			_tmp8_ = node;
			_tmp9_ = _tmp8_->ll_next;
			_tmp10_ = _gee_priority_queue_node_ref0 (_tmp9_);
			_gee_priority_queue_node_unref0 (_tmp7_->ll_next);
			_tmp7_->ll_next = _tmp10_;
		} else {
			GeePriorityQueueType1Node* _tmp11_ = NULL;
			GeePriorityQueueType1Node* _tmp12_ = NULL;
			_tmp11_ = self->priv->_ll_head;
			_tmp12_ = node;
			if (_tmp11_ == _tmp12_) {
				GeePriorityQueueType1Node* _tmp13_ = NULL;
				GeePriorityQueueType1Node* _tmp14_ = NULL;
				GeePriorityQueueType1Node* _tmp15_ = NULL;
				_tmp13_ = node;
				_tmp14_ = _tmp13_->ll_next;
				_tmp15_ = _gee_priority_queue_node_ref0 (_tmp14_);
				_gee_priority_queue_node_unref0 (self->priv->_ll_head);
				self->priv->_ll_head = _tmp15_;
			}
		}
		_tmp16_ = node;
		_tmp17_ = _tmp16_->ll_next;
		if (_tmp17_ != NULL) {
			GeePriorityQueueType1Node* _tmp18_ = NULL;
			GeePriorityQueueType1Node* _tmp19_ = NULL;
			GeePriorityQueueType1Node* _tmp20_ = NULL;
			GeePriorityQueueType1Node* _tmp21_ = NULL;
			_tmp18_ = node;
			_tmp19_ = _tmp18_->ll_next;
			_tmp20_ = node;
			_tmp21_ = _tmp20_->ll_prev;
			_tmp19_->ll_prev = _tmp21_;
		} else {
			GeePriorityQueueType1Node* _tmp22_ = NULL;
			GeePriorityQueueType1Node* _tmp23_ = NULL;
			_tmp22_ = self->priv->_ll_tail;
			_tmp23_ = node;
			if (_tmp22_ == _tmp23_) {
				GeePriorityQueueType1Node* _tmp24_ = NULL;
				GeePriorityQueueType1Node* _tmp25_ = NULL;
				GeePriorityQueueType1Node* _tmp26_ = NULL;
				_tmp24_ = node;
				_tmp25_ = _tmp24_->ll_prev;
				_tmp26_ = _gee_priority_queue_node_ref0 (_tmp25_);
				_gee_priority_queue_node_unref0 (self->priv->_ll_tail);
				self->priv->_ll_tail = _tmp26_;
			}
		}
		_tmp27_ = node;
		_tmp28_ = ((GeePriorityQueueNode*) _tmp27_)->parent;
		if (_tmp28_ != NULL) {
			GeePriorityQueueType1Node* _tmp29_ = NULL;
			GeePriorityQueueNode* _tmp30_ = NULL;
			GeePriorityQueueNode* _tmp31_ = NULL;
			GeePriorityQueueType2Node* _tmp32_ = NULL;
			_tmp29_ = node;
			_tmp30_ = ((GeePriorityQueueNode*) _tmp29_)->parent;
			_tmp31_ = _tmp30_->parent;
			_tmp32_ = self->priv->_r_prime;
			if (_tmp31_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
				GeePriorityQueueType1Node* _tmp33_ = NULL;
				GeePriorityQueueNode* _tmp34_ = NULL;
				_tmp33_ = node;
				_tmp34_ = ((GeePriorityQueueNode*) _tmp33_)->parent;
				_gee_priority_queue_updated_degree (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node), TRUE);
			} else {
				GeePriorityQueueType1Node* _tmp35_ = NULL;
				GeePriorityQueueNode* _tmp36_ = NULL;
				GeePriorityQueueNode* _tmp37_ = NULL;
				_tmp35_ = node;
				_tmp36_ = ((GeePriorityQueueNode*) _tmp35_)->parent;
				_tmp37_ = _tmp36_->parent;
				if (_tmp37_ != NULL) {
					GeePriorityQueueType1Node* parent = NULL;
					GeePriorityQueueType1Node* _tmp38_ = NULL;
					GeePriorityQueueNode* _tmp39_ = NULL;
					GeePriorityQueueType1Node* _tmp40_ = NULL;
					GeePriorityQueueType1Node* _tmp41_ = NULL;
					guint _tmp42_ = 0U;
					GeePriorityQueueType1Node* _tmp43_ = NULL;
					guint _tmp44_ = 0U;
					_tmp38_ = node;
					_tmp39_ = ((GeePriorityQueueNode*) _tmp38_)->parent;
					_tmp40_ = _gee_priority_queue_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node));
					parent = _tmp40_;
					_tmp41_ = parent;
					_tmp42_ = _tmp41_->lost;
					_tmp41_->lost = _tmp42_ + 1;
					_tmp43_ = parent;
					_tmp44_ = _tmp43_->lost;
					if (_tmp44_ > ((guint) 1)) {
						GeePriorityQueueType1Node* _tmp45_ = NULL;
						GeePriorityQueueType1Node* _tmp53_ = NULL;
						GeePriorityQueueType1Node* _tmp54_ = NULL;
						_tmp45_ = self->priv->_ll_tail;
						if (_tmp45_ != NULL) {
							GeePriorityQueueType1Node* _tmp46_ = NULL;
							GeePriorityQueueType1Node* _tmp47_ = NULL;
							GeePriorityQueueType1Node* _tmp48_ = NULL;
							GeePriorityQueueType1Node* _tmp49_ = NULL;
							GeePriorityQueueType1Node* _tmp50_ = NULL;
							_tmp46_ = parent;
							_tmp47_ = self->priv->_ll_tail;
							_tmp46_->ll_prev = _tmp47_;
							_tmp48_ = self->priv->_ll_tail;
							_tmp49_ = parent;
							_tmp50_ = _gee_priority_queue_node_ref0 (_tmp49_);
							_gee_priority_queue_node_unref0 (_tmp48_->ll_next);
							_tmp48_->ll_next = _tmp50_;
						} else {
							GeePriorityQueueType1Node* _tmp51_ = NULL;
							GeePriorityQueueType1Node* _tmp52_ = NULL;
							_tmp51_ = parent;
							_tmp52_ = _gee_priority_queue_node_ref0 (_tmp51_);
							_gee_priority_queue_node_unref0 (self->priv->_ll_head);
							self->priv->_ll_head = _tmp52_;
						}
						_tmp53_ = parent;
						_tmp54_ = _gee_priority_queue_node_ref0 (_tmp53_);
						_gee_priority_queue_node_unref0 (self->priv->_ll_tail);
						self->priv->_ll_tail = _tmp54_;
					}
					_gee_priority_queue_node_unref0 (parent);
				}
			}
		}
	}
	_tmp55_ = node;
	_tmp56_ = self->priv->_p;
	if (_tmp55_ == _tmp56_) {
		GeePriorityQueueType1Node* _tmp57_ = NULL;
		GeePriorityQueueType1Node* _tmp58_ = NULL;
		_tmp57_ = self->priv->_r;
		_tmp58_ = _gee_priority_queue_node_ref0 (_tmp57_);
		_gee_priority_queue_node_unref0 (self->priv->_p);
		self->priv->_p = _tmp58_;
	}
	_tmp59_ = node;
	gee_priority_queue_type1_node_remove (_tmp59_);
	_tmp60_ = with_iteration;
	if (_tmp60_) {
		GeePriorityQueueType1Node* _tmp61_ = NULL;
		GeePriorityQueueNode* _tmp62_ = NULL;
		GeePriorityQueueType1Node* _tmp71_ = NULL;
		GeePriorityQueueNode* _tmp72_ = NULL;
		_tmp61_ = node;
		_tmp62_ = ((GeePriorityQueueNode*) _tmp61_)->iter_prev;
		if (_tmp62_ != NULL) {
			GeePriorityQueueType1Node* _tmp63_ = NULL;
			GeePriorityQueueNode* _tmp64_ = NULL;
			GeePriorityQueueType1Node* _tmp65_ = NULL;
			GeePriorityQueueNode* _tmp66_ = NULL;
			_tmp63_ = node;
			_tmp64_ = ((GeePriorityQueueNode*) _tmp63_)->iter_prev;
			_tmp65_ = node;
			_tmp66_ = ((GeePriorityQueueNode*) _tmp65_)->iter_next;
			_tmp64_->iter_next = _tmp66_;
		} else {
			GeePriorityQueueNode* _tmp67_ = NULL;
			GeePriorityQueueType1Node* _tmp68_ = NULL;
			_tmp67_ = self->priv->_iter_head;
			_tmp68_ = node;
			if (_tmp67_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
				GeePriorityQueueType1Node* _tmp69_ = NULL;
				GeePriorityQueueNode* _tmp70_ = NULL;
				_tmp69_ = node;
				_tmp70_ = ((GeePriorityQueueNode*) _tmp69_)->iter_next;
				self->priv->_iter_head = _tmp70_;
			}
		}
		_tmp71_ = node;
		_tmp72_ = ((GeePriorityQueueNode*) _tmp71_)->iter_next;
		if (_tmp72_ != NULL) {
			GeePriorityQueueType1Node* _tmp73_ = NULL;
			GeePriorityQueueNode* _tmp74_ = NULL;
			GeePriorityQueueType1Node* _tmp75_ = NULL;
			GeePriorityQueueNode* _tmp76_ = NULL;
			_tmp73_ = node;
			_tmp74_ = ((GeePriorityQueueNode*) _tmp73_)->iter_next;
			_tmp75_ = node;
			_tmp76_ = ((GeePriorityQueueNode*) _tmp75_)->iter_prev;
			_tmp74_->iter_prev = _tmp76_;
		} else {
			GeePriorityQueueNode* _tmp77_ = NULL;
			GeePriorityQueueType1Node* _tmp78_ = NULL;
			_tmp77_ = self->priv->_iter_tail;
			_tmp78_ = node;
			if (_tmp77_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
				GeePriorityQueueType1Node* _tmp79_ = NULL;
				GeePriorityQueueNode* _tmp80_ = NULL;
				_tmp79_ = node;
				_tmp80_ = ((GeePriorityQueueNode*) _tmp79_)->iter_prev;
				self->priv->_iter_tail = _tmp80_;
			}
		}
	}
}


static void _gee_priority_queue_updated_degree (GeePriorityQueue* self, GeePriorityQueueType1Node* node, gboolean child_removed) {
	gint degree = 0;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GeePriorityQueueType1Node** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean* _tmp24_ = NULL;
	gint _tmp24__length1 = 0;
	gint _tmp25_ = 0;
	gboolean* _tmp26_ = NULL;
	gint _tmp26__length1 = 0;
	gint _tmp27_ = 0;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GeePriorityQueueType1Node** _tmp30_ = NULL;
	gint _tmp30__length1 = 0;
	gint _tmp31_ = 0;
	GeePriorityQueueType1Node* _tmp32_ = NULL;
	GeePriorityQueueType1Node* _tmp33_ = NULL;
	GeePriorityQueueType1Node* _tmp61_ = NULL;
	GeePriorityQueueNodePair* _tmp62_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	_tmp1_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp0_);
	degree = _tmp1_;
	_tmp2_ = degree;
	_tmp3_ = self->priv->_a;
	_tmp3__length1 = self->priv->_a_length1;
	if (_tmp2_ >= _tmp3__length1) {
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		_tmp4_ = degree;
		_tmp5_ = _tmp4_ + 1;
		self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp4_ + 1);
		(_tmp5_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp5_ - self->priv->_a_length1)) : NULL;
		self->priv->_a_length1 = _tmp5_;
		self->priv->__a_size_ = _tmp5_;
		_tmp6_ = degree;
		_tmp7_ = _tmp6_ + 1;
		self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp6_ + 1);
		(_tmp7_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp7_ - self->priv->_b_length1)) : NULL;
		self->priv->_b_length1 = _tmp7_;
		self->priv->__b_size_ = _tmp7_;
	}
	_tmp9_ = child_removed;
	if (_tmp9_) {
		GeePriorityQueueType1Node** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		gint _tmp11_ = 0;
		GeePriorityQueueType1Node* _tmp12_ = NULL;
		_tmp10_ = self->priv->_a;
		_tmp10__length1 = self->priv->_a_length1;
		_tmp11_ = degree;
		_tmp12_ = _tmp10_[_tmp11_ - 1];
		_tmp8_ = _tmp12_ == NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		GeePriorityQueueType1Node** _tmp13_ = NULL;
		gint _tmp13__length1 = 0;
		gint _tmp14_ = 0;
		GeePriorityQueueType1Node* _tmp15_ = NULL;
		GeePriorityQueueType1Node* _tmp16_ = NULL;
		GeePriorityQueueType1Node* _tmp17_ = NULL;
		gboolean* _tmp18_ = NULL;
		gint _tmp18__length1 = 0;
		gint _tmp19_ = 0;
		gboolean* _tmp20_ = NULL;
		gint _tmp20__length1 = 0;
		gint _tmp21_ = 0;
		gboolean _tmp22_ = FALSE;
		gboolean _tmp23_ = FALSE;
		_tmp13_ = self->priv->_a;
		_tmp13__length1 = self->priv->_a_length1;
		_tmp14_ = degree;
		_tmp15_ = node;
		_tmp16_ = _gee_priority_queue_node_ref0 (_tmp15_);
		_gee_priority_queue_node_unref0 (_tmp13_[_tmp14_ - 1]);
		_tmp13_[_tmp14_ - 1] = _tmp16_;
		_tmp17_ = _tmp13_[_tmp14_ - 1];
		_tmp18_ = self->priv->_b;
		_tmp18__length1 = self->priv->_b_length1;
		_tmp19_ = degree;
		_tmp20_ = self->priv->_b;
		_tmp20__length1 = self->priv->_b_length1;
		_tmp21_ = degree;
		_tmp22_ = _tmp20_[_tmp21_ - 1];
		_tmp18_[_tmp19_ - 1] = !_tmp22_;
		_tmp23_ = _tmp18_[_tmp19_ - 1];
	}
	_tmp24_ = self->priv->_b;
	_tmp24__length1 = self->priv->_b_length1;
	_tmp25_ = degree;
	_tmp26_ = self->priv->_b;
	_tmp26__length1 = self->priv->_b_length1;
	_tmp27_ = degree;
	_tmp28_ = _tmp26_[_tmp27_];
	_tmp24_[_tmp25_] = !_tmp28_;
	_tmp29_ = _tmp24_[_tmp25_];
	_tmp30_ = self->priv->_a;
	_tmp30__length1 = self->priv->_a_length1;
	_tmp31_ = degree;
	_tmp32_ = _tmp30_[_tmp31_];
	_tmp33_ = node;
	if (_tmp32_ == _tmp33_) {
		GeePriorityQueueType1Node* next = NULL;
		GeePriorityQueueType1Node* _tmp34_ = NULL;
		GeePriorityQueueType1Node* _tmp35_ = NULL;
		GeePriorityQueueType1Node* _tmp36_ = NULL;
		gboolean _tmp37_ = FALSE;
		GeePriorityQueueType1Node* _tmp38_ = NULL;
		_tmp34_ = node;
		_tmp35_ = _tmp34_->brothers_next;
		_tmp36_ = _gee_priority_queue_node_ref0 (_tmp35_);
		next = _tmp36_;
		_tmp38_ = next;
		if (_tmp38_ != NULL) {
			GeePriorityQueueType1Node* _tmp39_ = NULL;
			gint _tmp40_ = 0;
			gint _tmp41_ = 0;
			_tmp39_ = next;
			_tmp40_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp39_);
			_tmp41_ = degree;
			_tmp37_ = _tmp40_ == _tmp41_;
		} else {
			_tmp37_ = FALSE;
		}
		if (_tmp37_) {
			GeePriorityQueueType1Node** _tmp42_ = NULL;
			gint _tmp42__length1 = 0;
			gint _tmp43_ = 0;
			GeePriorityQueueType1Node* _tmp44_ = NULL;
			GeePriorityQueueType1Node* _tmp45_ = NULL;
			GeePriorityQueueType1Node* _tmp46_ = NULL;
			_tmp42_ = self->priv->_a;
			_tmp42__length1 = self->priv->_a_length1;
			_tmp43_ = degree;
			_tmp44_ = next;
			_tmp45_ = _gee_priority_queue_node_ref0 (_tmp44_);
			_gee_priority_queue_node_unref0 (_tmp42_[_tmp43_]);
			_tmp42_[_tmp43_] = _tmp45_;
			_tmp46_ = _tmp42_[_tmp43_];
		} else {
			GeePriorityQueueType1Node** _tmp47_ = NULL;
			gint _tmp47__length1 = 0;
			gint _tmp48_ = 0;
			GeePriorityQueueType1Node* _tmp49_ = NULL;
			gint i = 0;
			GeePriorityQueueType1Node** _tmp50_ = NULL;
			gint _tmp50__length1 = 0;
			gint _tmp57_ = 0;
			gint _tmp58_ = 0;
			gint _tmp59_ = 0;
			gint _tmp60_ = 0;
			_tmp47_ = self->priv->_a;
			_tmp47__length1 = self->priv->_a_length1;
			_tmp48_ = degree;
			_gee_priority_queue_node_unref0 (_tmp47_[_tmp48_]);
			_tmp47_[_tmp48_] = NULL;
			_tmp49_ = _tmp47_[_tmp48_];
			_tmp50_ = self->priv->_a;
			_tmp50__length1 = self->priv->_a_length1;
			i = _tmp50__length1 - 1;
			while (TRUE) {
				gboolean _tmp51_ = FALSE;
				gint _tmp52_ = 0;
				gint _tmp56_ = 0;
				_tmp52_ = i;
				if (_tmp52_ >= 0) {
					GeePriorityQueueType1Node** _tmp53_ = NULL;
					gint _tmp53__length1 = 0;
					gint _tmp54_ = 0;
					GeePriorityQueueType1Node* _tmp55_ = NULL;
					_tmp53_ = self->priv->_a;
					_tmp53__length1 = self->priv->_a_length1;
					_tmp54_ = i;
					_tmp55_ = _tmp53_[_tmp54_];
					_tmp51_ = _tmp55_ == NULL;
				} else {
					_tmp51_ = FALSE;
				}
				if (!_tmp51_) {
					break;
				}
				_tmp56_ = i;
				i = _tmp56_ - 1;
			}
			_tmp57_ = i;
			_tmp58_ = _tmp57_ + 1;
			self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp57_ + 1);
			(_tmp58_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp58_ - self->priv->_a_length1)) : NULL;
			self->priv->_a_length1 = _tmp58_;
			self->priv->__a_size_ = _tmp58_;
			_tmp59_ = i;
			_tmp60_ = _tmp59_ + 1;
			self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp59_ + 1);
			(_tmp60_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp60_ - self->priv->_b_length1)) : NULL;
			self->priv->_b_length1 = _tmp60_;
			self->priv->__b_size_ = _tmp60_;
		}
		_gee_priority_queue_node_unref0 (next);
	}
	_tmp61_ = node;
	_tmp62_ = _tmp61_->pair;
	if (_tmp62_ != NULL) {
		GeePriorityQueueNodePair* pair = NULL;
		GeePriorityQueueType1Node* _tmp63_ = NULL;
		GeePriorityQueueNodePair* _tmp64_ = NULL;
		GeePriorityQueueType1Node* _tmp65_ = NULL;
		GeePriorityQueueNodePair* _tmp66_ = NULL;
		GeePriorityQueueType1Node* _tmp67_ = NULL;
		GeePriorityQueueType1Node* _tmp68_ = NULL;
		GeePriorityQueueType1Node* other = NULL;
		GeePriorityQueueType1Node* _tmp73_ = NULL;
		GeePriorityQueueType1Node* _tmp74_ = NULL;
		GeePriorityQueueType1Node* _tmp75_ = NULL;
		GeePriorityQueueNodePair* _tmp76_ = NULL;
		GeePriorityQueueNodePair* _tmp77_ = NULL;
		GeePriorityQueueNodePair* _tmp84_ = NULL;
		GeePriorityQueueNodePair* _tmp85_ = NULL;
		_tmp63_ = node;
		_tmp64_ = _tmp63_->pair;
		pair = _tmp64_;
		_tmp66_ = pair;
		_tmp67_ = _tmp66_->node1;
		_tmp68_ = node;
		if (_tmp67_ == _tmp68_) {
			GeePriorityQueueNodePair* _tmp69_ = NULL;
			GeePriorityQueueType1Node* _tmp70_ = NULL;
			_tmp69_ = pair;
			_tmp70_ = _tmp69_->node2;
			_tmp65_ = _tmp70_;
		} else {
			GeePriorityQueueNodePair* _tmp71_ = NULL;
			GeePriorityQueueType1Node* _tmp72_ = NULL;
			_tmp71_ = pair;
			_tmp72_ = _tmp71_->node1;
			_tmp65_ = _tmp72_;
		}
		_tmp73_ = _gee_priority_queue_node_ref0 (_tmp65_);
		other = _tmp73_;
		_tmp74_ = node;
		_tmp74_->pair = NULL;
		_tmp75_ = other;
		_tmp75_->pair = NULL;
		_tmp76_ = pair;
		_tmp77_ = _tmp76_->lp_next;
		if (_tmp77_ != NULL) {
			GeePriorityQueueNodePair* _tmp78_ = NULL;
			GeePriorityQueueNodePair* _tmp79_ = NULL;
			GeePriorityQueueNodePair* _tmp80_ = NULL;
			GeePriorityQueueNodePair* _tmp81_ = NULL;
			_tmp78_ = pair;
			_tmp79_ = _tmp78_->lp_next;
			_tmp80_ = pair;
			_tmp81_ = _tmp80_->lp_prev;
			_tmp79_->lp_prev = _tmp81_;
		} else {
			GeePriorityQueueNodePair* _tmp82_ = NULL;
			GeePriorityQueueNodePair* _tmp83_ = NULL;
			_tmp82_ = pair;
			_tmp83_ = _tmp82_->lp_prev;
			self->priv->_lp_tail = _tmp83_;
		}
		_tmp84_ = pair;
		_tmp85_ = _tmp84_->lp_prev;
		if (_tmp85_ != NULL) {
			GeePriorityQueueNodePair* _tmp86_ = NULL;
			GeePriorityQueueNodePair* _tmp87_ = NULL;
			GeePriorityQueueNodePair* _tmp88_ = NULL;
			GeePriorityQueueNodePair* _tmp89_ = NULL;
			_tmp86_ = pair;
			_tmp87_ = _tmp86_->lp_prev;
			_tmp88_ = pair;
			_tmp89_ = _tmp88_->lp_next;
			_tmp88_->lp_next = NULL;
			_gee_priority_queue_node_pair_free0 (_tmp87_->lp_next);
			_tmp87_->lp_next = _tmp89_;
		} else {
			GeePriorityQueueNodePair* _tmp90_ = NULL;
			GeePriorityQueueNodePair* _tmp91_ = NULL;
			_tmp90_ = pair;
			_tmp91_ = _tmp90_->lp_next;
			_tmp90_->lp_next = NULL;
			_gee_priority_queue_node_pair_free0 (self->priv->_lp_head);
			self->priv->_lp_head = _tmp91_;
		}
		_gee_priority_queue_node_unref0 (other);
	}
}


static void _gee_priority_queue_remove_type2_node (GeePriorityQueue* self, GeePriorityQueueType2Node* node, gboolean with_iteration) {
	GeePriorityQueueType2Node* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueType2Node* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	_tmp1_ = ((GeePriorityQueueNode*) _tmp0_)->parent;
	_gee_priority_queue_node_unref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node)->type2_child);
	G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node)->type2_child = NULL;
	_tmp2_ = node;
	((GeePriorityQueueNode*) _tmp2_)->parent = NULL;
	_tmp3_ = with_iteration;
	if (_tmp3_) {
		GeePriorityQueueType2Node* _tmp4_ = NULL;
		GeePriorityQueueNode* _tmp5_ = NULL;
		GeePriorityQueueType2Node* _tmp14_ = NULL;
		GeePriorityQueueNode* _tmp15_ = NULL;
		_tmp4_ = node;
		_tmp5_ = ((GeePriorityQueueNode*) _tmp4_)->iter_prev;
		if (_tmp5_ != NULL) {
			GeePriorityQueueType2Node* _tmp6_ = NULL;
			GeePriorityQueueNode* _tmp7_ = NULL;
			GeePriorityQueueType2Node* _tmp8_ = NULL;
			GeePriorityQueueNode* _tmp9_ = NULL;
			_tmp6_ = node;
			_tmp7_ = ((GeePriorityQueueNode*) _tmp6_)->iter_prev;
			_tmp8_ = node;
			_tmp9_ = ((GeePriorityQueueNode*) _tmp8_)->iter_next;
			_tmp7_->iter_next = _tmp9_;
		} else {
			GeePriorityQueueNode* _tmp10_ = NULL;
			GeePriorityQueueType2Node* _tmp11_ = NULL;
			_tmp10_ = self->priv->_iter_head;
			_tmp11_ = node;
			if (_tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
				GeePriorityQueueType2Node* _tmp12_ = NULL;
				GeePriorityQueueNode* _tmp13_ = NULL;
				_tmp12_ = node;
				_tmp13_ = ((GeePriorityQueueNode*) _tmp12_)->iter_next;
				self->priv->_iter_head = _tmp13_;
			}
		}
		_tmp14_ = node;
		_tmp15_ = ((GeePriorityQueueNode*) _tmp14_)->iter_next;
		if (_tmp15_ != NULL) {
			GeePriorityQueueType2Node* _tmp16_ = NULL;
			GeePriorityQueueNode* _tmp17_ = NULL;
			GeePriorityQueueType2Node* _tmp18_ = NULL;
			GeePriorityQueueNode* _tmp19_ = NULL;
			_tmp16_ = node;
			_tmp17_ = ((GeePriorityQueueNode*) _tmp16_)->iter_next;
			_tmp18_ = node;
			_tmp19_ = ((GeePriorityQueueNode*) _tmp18_)->iter_prev;
			_tmp17_->iter_prev = _tmp19_;
		} else {
			GeePriorityQueueNode* _tmp20_ = NULL;
			GeePriorityQueueType2Node* _tmp21_ = NULL;
			_tmp20_ = self->priv->_iter_tail;
			_tmp21_ = node;
			if (_tmp20_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) {
				GeePriorityQueueType2Node* _tmp22_ = NULL;
				GeePriorityQueueNode* _tmp23_ = NULL;
				_tmp22_ = node;
				_tmp23_ = ((GeePriorityQueueNode*) _tmp22_)->iter_prev;
				self->priv->_iter_tail = _tmp23_;
			}
		}
	}
}


GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target) {
	GCompareDataFunc result;
	GCompareDataFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GCompareDataFunc _tmp1_ = NULL;
	void* _tmp1__target = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compare_func;
	_tmp0__target = self->priv->_compare_func_target;
	_tmp1_ = _tmp0_;
	_tmp1__target = _tmp0__target;
	*result_target = _tmp1__target;
	result = _tmp1_;
	return result;
}


static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareDataFunc value, gpointer value_target) {
	g_return_if_fail (self != NULL);
}


static gint gee_priority_queue_real_get_capacity (GeeAbstractQueue* base) {
	gint result;
	GeePriorityQueue* self;
	self = (GeePriorityQueue*) base;
	result = GEE_QUEUE_UNBOUNDED_CAPACITY;
	return result;
}


static gint gee_priority_queue_real_get_remaining_capacity (GeeAbstractQueue* base) {
	gint result;
	GeePriorityQueue* self;
	self = (GeePriorityQueue*) base;
	result = GEE_QUEUE_UNBOUNDED_CAPACITY;
	return result;
}


static gboolean gee_priority_queue_real_get_is_full (GeeAbstractQueue* base) {
	gboolean result;
	GeePriorityQueue* self;
	self = (GeePriorityQueue*) base;
	result = FALSE;
	return result;
}


static gboolean gee_priority_queue_real_get_read_only (GeeAbstractCollection* base) {
	gboolean result;
	GeePriorityQueue* self;
	self = (GeePriorityQueue*) base;
	result = FALSE;
	return result;
}


static gint gee_priority_queue_real_get_size (GeeAbstractCollection* base) {
	gint result;
	GeePriorityQueue* self;
	gint _tmp0_ = 0;
	self = (GeePriorityQueue*) base;
	_tmp0_ = self->priv->_size;
	result = _tmp0_;
	return result;
}


static GeePriorityQueueNode* gee_priority_queue_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail) {
	GeePriorityQueueNode* self = NULL;
	gconstpointer _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	GeePriorityQueueNode* _tmp2_ = NULL;
	GeePriorityQueueNode* _tmp3_ = NULL;
	GeePriorityQueueNode* _tmp5_ = NULL;
	self = (GeePriorityQueueNode*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = data;
	_tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	_g_destroy_func0 (self->data);
	self->data = _tmp1_;
	_tmp2_ = *tail;
	self->iter_prev = _tmp2_;
	*tail = self;
	_tmp3_ = self->iter_prev;
	if (_tmp3_ != NULL) {
		GeePriorityQueueNode* _tmp4_ = NULL;
		_tmp4_ = self->iter_prev;
		_tmp4_->iter_next = self;
	}
	_tmp5_ = *head;
	if (_tmp5_ == NULL) {
		*head = self;
	}
	return self;
}


static inline gint gee_priority_queue_node_degree (GeePriorityQueueNode* self) {
	gint result = 0;
	gint _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->type1_children_count;
	result = _tmp0_;
	return result;
}


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


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


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


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


static gchar* gee_priority_queue_value_node_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GeePriorityQueueNode* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gee_priority_queue_node_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gee_priority_queue_value_node_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GeePriorityQueueNode** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gee_priority_queue_node_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* gee_priority_queue_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GeePriorityQueueParamSpecNode* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GEE_PRIORITY_QUEUE_TYPE_NODE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer gee_priority_queue_value_get_node (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE), NULL);
	return value->data[0].v_pointer;
}


static void gee_priority_queue_value_set_node (GValue* value, gpointer v_object) {
	GeePriorityQueueNode* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_PRIORITY_QUEUE_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gee_priority_queue_node_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_priority_queue_node_unref (old);
	}
}


static void gee_priority_queue_value_take_node (GValue* value, gpointer v_object) {
	GeePriorityQueueNode* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_PRIORITY_QUEUE_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_priority_queue_node_unref (old);
	}
}


static void gee_priority_queue_node_class_init (GeePriorityQueueNodeClass * klass) {
	gee_priority_queue_node_parent_class = g_type_class_peek_parent (klass);
	((GeePriorityQueueNodeClass *) klass)->finalize = gee_priority_queue_node_finalize;
	g_type_class_add_private (klass, sizeof (GeePriorityQueueNodePrivate));
}


static void gee_priority_queue_node_instance_init (GeePriorityQueueNode * self) {
	self->priv = GEE_PRIORITY_QUEUE_NODE_GET_PRIVATE (self);
	self->parent = NULL;
	self->type1_children_head = NULL;
	self->type1_children_tail = NULL;
	self->iter_next = NULL;
	self->ref_count = 1;
}


static void gee_priority_queue_node_finalize (GeePriorityQueueNode* obj) {
	GeePriorityQueueNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode);
	g_signal_handlers_destroy (self);
	((self->data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->data = (self->priv->g_destroy_func (self->data), NULL));
	_gee_priority_queue_node_unref0 (self->type1_children_head);
	_gee_priority_queue_node_unref0 (self->type1_children_tail);
}


static GType gee_priority_queue_node_get_type (void) {
	static volatile gsize gee_priority_queue_node_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_node_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gee_priority_queue_value_node_init, gee_priority_queue_value_node_free_value, gee_priority_queue_value_node_copy_value, gee_priority_queue_value_node_peek_pointer, "p", gee_priority_queue_value_node_collect_value, "p", gee_priority_queue_value_node_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueNode), 0, (GInstanceInitFunc) gee_priority_queue_node_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gee_priority_queue_node_type_id;
		gee_priority_queue_node_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeePriorityQueueNode", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&gee_priority_queue_node_type_id__volatile, gee_priority_queue_node_type_id);
	}
	return gee_priority_queue_node_type_id__volatile;
}


static gpointer gee_priority_queue_node_ref (gpointer instance) {
	GeePriorityQueueNode* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void gee_priority_queue_node_unref (gpointer instance) {
	GeePriorityQueueNode* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GEE_PRIORITY_QUEUE_NODE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static GeePriorityQueueType1Node* gee_priority_queue_type1_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail) {
	GeePriorityQueueType1Node* self = NULL;
	gconstpointer _tmp0_ = NULL;
	_tmp0_ = data;
	self = (GeePriorityQueueType1Node*) gee_priority_queue_node_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, head, tail);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}


static GeePriorityQueueType1Node* gee_priority_queue_type1_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail) {
	return gee_priority_queue_type1_node_construct (GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, g_type, g_dup_func, g_destroy_func, data, head, tail);
}


static inline void gee_priority_queue_type1_node_add (GeePriorityQueueType1Node* self, GeePriorityQueueType1Node* node) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	GeePriorityQueueType1Node* _tmp6_ = NULL;
	GeePriorityQueueType1Node* _tmp10_ = NULL;
	GeePriorityQueueType1Node* _tmp11_ = NULL;
	gint _tmp12_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	((GeePriorityQueueNode*) _tmp0_)->parent = (GeePriorityQueueNode*) self;
	_tmp1_ = ((GeePriorityQueueNode*) self)->type1_children_head;
	if (_tmp1_ == NULL) {
		GeePriorityQueueType1Node* _tmp2_ = NULL;
		GeePriorityQueueType1Node* _tmp3_ = NULL;
		_tmp2_ = node;
		_tmp3_ = _gee_priority_queue_node_ref0 (_tmp2_);
		_gee_priority_queue_node_unref0 (((GeePriorityQueueNode*) self)->type1_children_head);
		((GeePriorityQueueNode*) self)->type1_children_head = _tmp3_;
	} else {
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		GeePriorityQueueType1Node* _tmp5_ = NULL;
		_tmp4_ = node;
		_tmp5_ = ((GeePriorityQueueNode*) self)->type1_children_tail;
		_tmp4_->brothers_prev = _tmp5_;
	}
	_tmp6_ = ((GeePriorityQueueNode*) self)->type1_children_tail;
	if (_tmp6_ != NULL) {
		GeePriorityQueueType1Node* _tmp7_ = NULL;
		GeePriorityQueueType1Node* _tmp8_ = NULL;
		GeePriorityQueueType1Node* _tmp9_ = NULL;
		_tmp7_ = ((GeePriorityQueueNode*) self)->type1_children_tail;
		_tmp8_ = node;
		_tmp9_ = _gee_priority_queue_node_ref0 (_tmp8_);
		_gee_priority_queue_node_unref0 (_tmp7_->brothers_next);
		_tmp7_->brothers_next = _tmp9_;
	}
	_tmp10_ = node;
	_tmp11_ = _gee_priority_queue_node_ref0 (_tmp10_);
	_gee_priority_queue_node_unref0 (((GeePriorityQueueNode*) self)->type1_children_tail);
	((GeePriorityQueueNode*) self)->type1_children_tail = _tmp11_;
	_tmp12_ = ((GeePriorityQueueNode*) self)->type1_children_count;
	((GeePriorityQueueNode*) self)->type1_children_count = _tmp12_ + 1;
}


static inline void gee_priority_queue_type1_node_remove (GeePriorityQueueType1Node* self) {
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp7_ = NULL;
	GeePriorityQueueNode* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->brothers_prev;
	if (_tmp0_ == NULL) {
		GeePriorityQueueNode* _tmp1_ = NULL;
		GeePriorityQueueType1Node* _tmp2_ = NULL;
		GeePriorityQueueType1Node* _tmp3_ = NULL;
		_tmp1_ = ((GeePriorityQueueNode*) self)->parent;
		_tmp2_ = self->brothers_next;
		_tmp3_ = _gee_priority_queue_node_ref0 (_tmp2_);
		_gee_priority_queue_node_unref0 (_tmp1_->type1_children_head);
		_tmp1_->type1_children_head = _tmp3_;
	} else {
		GeePriorityQueueType1Node* _tmp4_ = NULL;
		GeePriorityQueueType1Node* _tmp5_ = NULL;
		GeePriorityQueueType1Node* _tmp6_ = NULL;
		_tmp4_ = self->brothers_prev;
		_tmp5_ = self->brothers_next;
		_tmp6_ = _gee_priority_queue_node_ref0 (_tmp5_);
		_gee_priority_queue_node_unref0 (_tmp4_->brothers_next);
		_tmp4_->brothers_next = _tmp6_;
	}
	_tmp7_ = self->brothers_next;
	if (_tmp7_ == NULL) {
		GeePriorityQueueNode* _tmp8_ = NULL;
		GeePriorityQueueType1Node* _tmp9_ = NULL;
		GeePriorityQueueType1Node* _tmp10_ = NULL;
		_tmp8_ = ((GeePriorityQueueNode*) self)->parent;
		_tmp9_ = self->brothers_prev;
		_tmp10_ = _gee_priority_queue_node_ref0 (_tmp9_);
		_gee_priority_queue_node_unref0 (_tmp8_->type1_children_tail);
		_tmp8_->type1_children_tail = _tmp10_;
	} else {
		GeePriorityQueueType1Node* _tmp11_ = NULL;
		GeePriorityQueueType1Node* _tmp12_ = NULL;
		_tmp11_ = self->brothers_next;
		_tmp12_ = self->brothers_prev;
		_tmp11_->brothers_prev = _tmp12_;
	}
	_tmp13_ = ((GeePriorityQueueNode*) self)->parent;
	_tmp14_ = _tmp13_->type1_children_count;
	_tmp13_->type1_children_count = _tmp14_ - 1;
	((GeePriorityQueueNode*) self)->parent = NULL;
	self->brothers_prev = NULL;
	_gee_priority_queue_node_unref0 (self->brothers_next);
	self->brothers_next = NULL;
}


static void gee_priority_queue_type1_node_class_init (GeePriorityQueueType1NodeClass * klass) {
	gee_priority_queue_type1_node_parent_class = g_type_class_peek_parent (klass);
	((GeePriorityQueueNodeClass *) klass)->finalize = gee_priority_queue_type1_node_finalize;
	g_type_class_add_private (klass, sizeof (GeePriorityQueueType1NodePrivate));
}


static void gee_priority_queue_type1_node_instance_init (GeePriorityQueueType1Node * self) {
	self->priv = GEE_PRIORITY_QUEUE_TYPE1_NODE_GET_PRIVATE (self);
	self->brothers_prev = NULL;
	self->brothers_next = NULL;
	self->type2_child = NULL;
	self->ll_prev = NULL;
	self->ll_next = NULL;
	self->pair = NULL;
}


static void gee_priority_queue_type1_node_finalize (GeePriorityQueueNode* obj) {
	GeePriorityQueueType1Node * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_PRIORITY_QUEUE_TYPE_TYPE1_NODE, GeePriorityQueueType1Node);
	_gee_priority_queue_node_unref0 (self->brothers_next);
	_gee_priority_queue_node_unref0 (self->type2_child);
	_gee_priority_queue_node_unref0 (self->ll_next);
	GEE_PRIORITY_QUEUE_NODE_CLASS (gee_priority_queue_type1_node_parent_class)->finalize (obj);
}


static GType gee_priority_queue_type1_node_get_type (void) {
	static volatile gsize gee_priority_queue_type1_node_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_type1_node_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueType1NodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_type1_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueType1Node), 0, (GInstanceInitFunc) gee_priority_queue_type1_node_instance_init, NULL };
		GType gee_priority_queue_type1_node_type_id;
		gee_priority_queue_type1_node_type_id = g_type_register_static (GEE_PRIORITY_QUEUE_TYPE_NODE, "GeePriorityQueueType1Node", &g_define_type_info, 0);
		g_once_init_leave (&gee_priority_queue_type1_node_type_id__volatile, gee_priority_queue_type1_node_type_id);
	}
	return gee_priority_queue_type1_node_type_id__volatile;
}


static GeePriorityQueueType2Node* gee_priority_queue_type2_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail) {
	GeePriorityQueueType2Node* self = NULL;
	gconstpointer _tmp0_ = NULL;
	_tmp0_ = data;
	self = (GeePriorityQueueType2Node*) gee_priority_queue_node_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, head, tail);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}


static GeePriorityQueueType2Node* gee_priority_queue_type2_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail) {
	return gee_priority_queue_type2_node_construct (GEE_PRIORITY_QUEUE_TYPE_TYPE2_NODE, g_type, g_dup_func, g_destroy_func, data, head, tail);
}


static void gee_priority_queue_type2_node_class_init (GeePriorityQueueType2NodeClass * klass) {
	gee_priority_queue_type2_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeePriorityQueueType2NodePrivate));
}


static void gee_priority_queue_type2_node_instance_init (GeePriorityQueueType2Node * self) {
	self->priv = GEE_PRIORITY_QUEUE_TYPE2_NODE_GET_PRIVATE (self);
}


static GType gee_priority_queue_type2_node_get_type (void) {
	static volatile gsize gee_priority_queue_type2_node_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_type2_node_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueType2NodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_type2_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueType2Node), 0, (GInstanceInitFunc) gee_priority_queue_type2_node_instance_init, NULL };
		GType gee_priority_queue_type2_node_type_id;
		gee_priority_queue_type2_node_type_id = g_type_register_static (GEE_PRIORITY_QUEUE_TYPE_NODE, "GeePriorityQueueType2Node", &g_define_type_info, 0);
		g_once_init_leave (&gee_priority_queue_type2_node_type_id__volatile, gee_priority_queue_type2_node_type_id);
	}
	return gee_priority_queue_type2_node_type_id__volatile;
}


static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next) {
	GeePriorityQueueDummyNode* self = NULL;
	GeePriorityQueueNode* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueNode* _tmp2_ = NULL;
	self = (GeePriorityQueueDummyNode*) gee_priority_queue_node_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, prev_next, next_prev);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = iter_prev;
	((GeePriorityQueueNode*) self)->iter_prev = _tmp0_;
	_tmp1_ = iter_next;
	((GeePriorityQueueNode*) self)->iter_next = _tmp1_;
	*next_prev = (GeePriorityQueueNode*) self;
	_tmp2_ = *next_prev;
	*prev_next = _tmp2_;
	return self;
}


static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next) {
	return gee_priority_queue_dummy_node_construct (GEE_PRIORITY_QUEUE_TYPE_DUMMY_NODE, g_type, g_dup_func, g_destroy_func, prev_next, next_prev, iter_prev, iter_next);
}


static void gee_priority_queue_dummy_node_class_init (GeePriorityQueueDummyNodeClass * klass) {
	gee_priority_queue_dummy_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeePriorityQueueDummyNodePrivate));
}


static void gee_priority_queue_dummy_node_instance_init (GeePriorityQueueDummyNode * self) {
	self->priv = GEE_PRIORITY_QUEUE_DUMMY_NODE_GET_PRIVATE (self);
}


static GType gee_priority_queue_dummy_node_get_type (void) {
	static volatile gsize gee_priority_queue_dummy_node_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_dummy_node_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueDummyNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_dummy_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueDummyNode), 0, (GInstanceInitFunc) gee_priority_queue_dummy_node_instance_init, NULL };
		GType gee_priority_queue_dummy_node_type_id;
		gee_priority_queue_dummy_node_type_id = g_type_register_static (GEE_PRIORITY_QUEUE_TYPE_NODE, "GeePriorityQueueDummyNode", &g_define_type_info, 0);
		g_once_init_leave (&gee_priority_queue_dummy_node_type_id__volatile, gee_priority_queue_dummy_node_type_id);
	}
	return gee_priority_queue_dummy_node_type_id__volatile;
}


static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2) {
	GeePriorityQueueNodePair* self;
	GeePriorityQueueType1Node* _tmp0_ = NULL;
	GeePriorityQueueType1Node* _tmp1_ = NULL;
	g_return_val_if_fail (node1 != NULL, NULL);
	g_return_val_if_fail (node2 != NULL, NULL);
	self = g_slice_new0 (GeePriorityQueueNodePair);
	gee_priority_queue_node_pair_instance_init (self);
	_tmp0_ = node1;
	self->node1 = _tmp0_;
	_tmp1_ = node2;
	self->node2 = _tmp1_;
	return self;
}


static void gee_priority_queue_node_pair_instance_init (GeePriorityQueueNodePair * self) {
	self->lp_prev = NULL;
	self->lp_next = NULL;
	self->node1 = NULL;
	self->node2 = NULL;
}


static void gee_priority_queue_node_pair_free (GeePriorityQueueNodePair* self) {
	_gee_priority_queue_node_pair_free0 (self->lp_next);
	g_slice_free (GeePriorityQueueNodePair, self);
}


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


static GeePriorityQueueIterator* gee_priority_queue_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue) {
	GeePriorityQueueIterator * self = NULL;
	GeePriorityQueue* _tmp0_ = NULL;
	GeePriorityQueue* _tmp1_ = NULL;
	GeePriorityQueue* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	g_return_val_if_fail (queue != NULL, NULL);
	self = (GeePriorityQueueIterator*) g_object_new (object_type, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = queue;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->queue);
	self->queue = _tmp1_;
	self->position = NULL;
	self->previous = NULL;
	_tmp2_ = queue;
	_tmp3_ = _tmp2_->priv->_stamp;
	self->stamp = _tmp3_;
	return self;
}


static GeePriorityQueueIterator* gee_priority_queue_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue) {
	return gee_priority_queue_iterator_construct (GEE_PRIORITY_QUEUE_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, queue);
}


static GeePriorityQueueIterator* gee_priority_queue_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueIterator* iter) {
	GeePriorityQueueIterator * self = NULL;
	GeePriorityQueueIterator* _tmp0_ = NULL;
	GeePriorityQueue* _tmp1_ = NULL;
	GeePriorityQueue* _tmp2_ = NULL;
	GeePriorityQueueIterator* _tmp3_ = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	GeePriorityQueueIterator* _tmp5_ = NULL;
	GeePriorityQueueNode* _tmp6_ = NULL;
	GeePriorityQueueIterator* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	g_return_val_if_fail (iter != NULL, NULL);
	self = (GeePriorityQueueIterator*) g_object_new (object_type, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = iter;
	_tmp1_ = _tmp0_->queue;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->queue);
	self->queue = _tmp2_;
	_tmp3_ = iter;
	_tmp4_ = _tmp3_->position;
	self->position = _tmp4_;
	_tmp5_ = iter;
	_tmp6_ = _tmp5_->previous;
	self->previous = _tmp6_;
	_tmp7_ = iter;
	_tmp8_ = _tmp7_->stamp;
	self->stamp = _tmp8_;
	return self;
}


static GeePriorityQueueIterator* gee_priority_queue_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueIterator* iter) {
	return gee_priority_queue_iterator_construct_from_iterator (GEE_PRIORITY_QUEUE_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iter);
}


static gboolean gee_priority_queue_iterator_real_next (GeeIterator* base) {
	GeePriorityQueueIterator * self;
	gboolean result = FALSE;
	GeePriorityQueueNode* next = NULL;
	GeePriorityQueueNode* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp1_ = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = _gee_priority_queue_iterator_get_next_node (self);
	next = _tmp0_;
	_tmp1_ = next;
	if (_tmp1_ != NULL) {
		GeePriorityQueueNode* _tmp2_ = NULL;
		GeePriorityQueueNode* _tmp3_ = NULL;
		_tmp2_ = self->position;
		self->previous = _tmp2_;
		_tmp3_ = next;
		self->position = _tmp3_;
	}
	_tmp4_ = next;
	result = _tmp4_ != NULL;
	return result;
}


static gboolean gee_priority_queue_iterator_real_has_next (GeeIterator* base) {
	GeePriorityQueueIterator * self;
	gboolean result = FALSE;
	GeePriorityQueueNode* _tmp0_ = NULL;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = _gee_priority_queue_iterator_get_next_node (self);
	result = _tmp0_ != NULL;
	return result;
}


static inline GeePriorityQueueNode* _gee_priority_queue_iterator_get_next_node (GeePriorityQueueIterator* self) {
	GeePriorityQueueNode* result = NULL;
	GeePriorityQueueNode* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->position;
	if (_tmp0_ != NULL) {
		GeePriorityQueueNode* _tmp1_ = NULL;
		GeePriorityQueueNode* _tmp2_ = NULL;
		_tmp1_ = self->position;
		_tmp2_ = _tmp1_->iter_next;
		result = _tmp2_;
		return result;
	} else {
		GeePriorityQueueNode* _tmp3_ = NULL;
		GeePriorityQueueNode* _tmp4_ = NULL;
		_tmp4_ = self->previous;
		if (_tmp4_ != NULL) {
			GeePriorityQueueNode* _tmp5_ = NULL;
			GeePriorityQueueNode* _tmp6_ = NULL;
			_tmp5_ = self->previous;
			_tmp6_ = _tmp5_->iter_next;
			_tmp3_ = _tmp6_;
		} else {
			GeePriorityQueue* _tmp7_ = NULL;
			GeePriorityQueueNode* _tmp8_ = NULL;
			_tmp7_ = self->queue;
			_tmp8_ = _tmp7_->priv->_iter_head;
			_tmp3_ = _tmp8_;
		}
		result = _tmp3_;
		return result;
	}
}


static gpointer gee_priority_queue_iterator_real_get (GeeIterator* base) {
	GeePriorityQueueIterator * self;
	gpointer result = NULL;
	gint _tmp0_ = 0;
	GeePriorityQueue* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GeePriorityQueueNode* _tmp3_ = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	gconstpointer _tmp5_ = NULL;
	gpointer _tmp6_ = NULL;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->queue;
	_tmp2_ = _tmp1_->priv->_stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == queue._stamp");
	_tmp3_ = self->position;
	_vala_assert (_tmp3_ != NULL, "position != null");
	_tmp4_ = self->position;
	_tmp5_ = _tmp4_->data;
	_tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
	result = _tmp6_;
	return result;
}


static void gee_priority_queue_iterator_real_remove (GeeIterator* base) {
	GeePriorityQueueIterator * self;
	gint _tmp0_ = 0;
	GeePriorityQueue* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GeePriorityQueueNode* _tmp3_ = NULL;
	GeePriorityQueueDummyNode* dn = NULL;
	GeePriorityQueueNode* _tmp4_ = NULL;
	GeePriorityQueue* _tmp14_ = NULL;
	GeePriorityQueueNode* _tmp15_ = NULL;
	GeePriorityQueueNode* _tmp16_ = NULL;
	GeePriorityQueueDummyNode* _tmp20_ = NULL;
	GeePriorityQueue* _tmp21_ = NULL;
	GeePriorityQueueNode* _tmp22_ = NULL;
	GeePriorityQueueDummyNode* _tmp26_ = NULL;
	GeePriorityQueueNode* _tmp27_ = NULL;
	GeePriorityQueueDummyNode* _tmp31_ = NULL;
	GeePriorityQueue* _tmp32_ = NULL;
	GeePriorityQueueNode* _tmp33_ = NULL;
	gint _tmp36_ = 0;
	gint _tmp37_ = 0;
	GeePriorityQueue* _tmp38_ = NULL;
	gint _tmp39_ = 0;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->queue;
	_tmp2_ = _tmp1_->priv->_stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == queue._stamp");
	_tmp3_ = self->position;
	_vala_assert (_tmp3_ != NULL, "position != null");
	_tmp4_ = self->previous;
	if (_tmp4_ != NULL) {
		GeePriorityQueueNode* _tmp5_ = NULL;
		GeePriorityQueueNode* _tmp6_ = NULL;
		GeePriorityQueueNode* _tmp7_ = NULL;
		GeePriorityQueueNode* _tmp8_ = NULL;
		GeePriorityQueueDummyNode* _tmp9_ = NULL;
		_tmp5_ = self->previous;
		_tmp6_ = self->position;
		_tmp7_ = self->previous;
		_tmp8_ = self->position;
		_tmp9_ = gee_priority_queue_dummy_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp5_->iter_next, &_tmp6_->iter_prev, _tmp7_, _tmp8_);
		_gee_priority_queue_node_unref0 (dn);
		dn = _tmp9_;
	} else {
		GeePriorityQueue* _tmp10_ = NULL;
		GeePriorityQueueNode* _tmp11_ = NULL;
		GeePriorityQueueNode* _tmp12_ = NULL;
		GeePriorityQueueDummyNode* _tmp13_ = NULL;
		_tmp10_ = self->queue;
		_tmp11_ = self->position;
		_tmp12_ = self->position;
		_tmp13_ = gee_priority_queue_dummy_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp10_->priv->_iter_head, &_tmp11_->iter_prev, NULL, _tmp12_);
		_gee_priority_queue_node_unref0 (dn);
		dn = _tmp13_;
	}
	_tmp14_ = self->queue;
	_tmp15_ = self->position;
	_gee_priority_queue_delete (_tmp14_, _tmp15_);
	self->position = NULL;
	_tmp16_ = self->previous;
	if (_tmp16_ != NULL) {
		GeePriorityQueueNode* _tmp17_ = NULL;
		GeePriorityQueueDummyNode* _tmp18_ = NULL;
		GeePriorityQueueNode* _tmp19_ = NULL;
		_tmp17_ = self->previous;
		_tmp18_ = dn;
		_tmp19_ = ((GeePriorityQueueNode*) _tmp18_)->iter_next;
		_tmp17_->iter_next = _tmp19_;
	}
	_tmp20_ = dn;
	_tmp21_ = self->queue;
	_tmp22_ = _tmp21_->priv->_iter_head;
	if (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode) == _tmp22_) {
		GeePriorityQueue* _tmp23_ = NULL;
		GeePriorityQueueDummyNode* _tmp24_ = NULL;
		GeePriorityQueueNode* _tmp25_ = NULL;
		_tmp23_ = self->queue;
		_tmp24_ = dn;
		_tmp25_ = ((GeePriorityQueueNode*) _tmp24_)->iter_next;
		_tmp23_->priv->_iter_head = _tmp25_;
	}
	_tmp26_ = dn;
	_tmp27_ = ((GeePriorityQueueNode*) _tmp26_)->iter_next;
	if (_tmp27_ != NULL) {
		GeePriorityQueueDummyNode* _tmp28_ = NULL;
		GeePriorityQueueNode* _tmp29_ = NULL;
		GeePriorityQueueNode* _tmp30_ = NULL;
		_tmp28_ = dn;
		_tmp29_ = ((GeePriorityQueueNode*) _tmp28_)->iter_next;
		_tmp30_ = self->previous;
		_tmp29_->iter_prev = _tmp30_;
	}
	_tmp31_ = dn;
	_tmp32_ = self->queue;
	_tmp33_ = _tmp32_->priv->_iter_tail;
	if (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode) == _tmp33_) {
		GeePriorityQueue* _tmp34_ = NULL;
		GeePriorityQueueNode* _tmp35_ = NULL;
		_tmp34_ = self->queue;
		_tmp35_ = self->previous;
		_tmp34_->priv->_iter_tail = _tmp35_;
	}
	_tmp36_ = self->stamp;
	self->stamp = _tmp36_ + 1;
	_tmp37_ = self->stamp;
	_tmp38_ = self->queue;
	_tmp39_ = _tmp38_->priv->_stamp;
	_vala_assert (_tmp37_ == _tmp39_, "stamp == queue._stamp");
	_gee_priority_queue_node_unref0 (dn);
}


static gboolean gee_priority_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
	GeePriorityQueueIterator * self;
	gboolean result = FALSE;
	GeePriorityQueueNode* _tmp0_ = NULL;
	GeePriorityQueueNode* _tmp7_ = NULL;
	GeeForallFunc _tmp8_ = NULL;
	void* _tmp8__target = NULL;
	GeePriorityQueueNode* _tmp9_ = NULL;
	gconstpointer _tmp10_ = NULL;
	gpointer _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = self->position;
	if (_tmp0_ == NULL) {
		GeePriorityQueueNode* _tmp1_ = NULL;
		GeePriorityQueueNode* _tmp2_ = NULL;
		_tmp2_ = self->previous;
		if (_tmp2_ != NULL) {
			GeePriorityQueueNode* _tmp3_ = NULL;
			GeePriorityQueueNode* _tmp4_ = NULL;
			_tmp3_ = self->previous;
			_tmp4_ = _tmp3_->iter_next;
			_tmp1_ = _tmp4_;
		} else {
			GeePriorityQueue* _tmp5_ = NULL;
			GeePriorityQueueNode* _tmp6_ = NULL;
			_tmp5_ = self->queue;
			_tmp6_ = _tmp5_->priv->_iter_head;
			_tmp1_ = _tmp6_;
		}
		self->position = _tmp1_;
	}
	_tmp7_ = self->position;
	if (_tmp7_ == NULL) {
		result = TRUE;
		return result;
	}
	_tmp8_ = f;
	_tmp8__target = f_target;
	_tmp9_ = self->position;
	_tmp10_ = _tmp9_->data;
	_tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_);
	_tmp12_ = _tmp8_ (_tmp11_, _tmp8__target);
	if (!_tmp12_) {
		result = FALSE;
		return result;
	}
	while (TRUE) {
		GeePriorityQueueNode* _tmp13_ = NULL;
		GeePriorityQueueNode* _tmp14_ = NULL;
		GeePriorityQueueNode* _tmp15_ = NULL;
		GeePriorityQueueNode* _tmp16_ = NULL;
		GeePriorityQueueNode* _tmp17_ = NULL;
		GeeForallFunc _tmp18_ = NULL;
		void* _tmp18__target = NULL;
		GeePriorityQueueNode* _tmp19_ = NULL;
		gconstpointer _tmp20_ = NULL;
		gpointer _tmp21_ = NULL;
		gboolean _tmp22_ = FALSE;
		_tmp13_ = self->position;
		_tmp14_ = _tmp13_->iter_next;
		if (!(_tmp14_ != NULL)) {
			break;
		}
		_tmp15_ = self->position;
		self->previous = _tmp15_;
		_tmp16_ = self->position;
		_tmp17_ = _tmp16_->iter_next;
		self->position = _tmp17_;
		_tmp18_ = f;
		_tmp18__target = f_target;
		_tmp19_ = self->position;
		_tmp20_ = _tmp19_->data;
		_tmp21_ = ((_tmp20_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp20_) : ((gpointer) _tmp20_);
		_tmp22_ = _tmp18_ (_tmp21_, _tmp18__target);
		if (!_tmp22_) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}


static GeeIterator** gee_priority_queue_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1) {
	GeePriorityQueueIterator * self;
	GeeIterator** result = NULL;
	guint _tmp0_ = 0U;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = forks;
	if (_tmp0_ == ((guint) 0)) {
		GeeIterator** _tmp1_ = NULL;
		GeeIterator** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		_tmp1_ = g_new0 (GeeIterator*, 0 + 1);
		_tmp2_ = _tmp1_;
		_tmp2__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp2__length1;
		}
		result = _tmp2_;
		return result;
	} else {
		GeeIterator** _result_ = NULL;
		guint _tmp3_ = 0U;
		GeeIterator** _tmp4_ = NULL;
		gint _result__length1 = 0;
		gint __result__size_ = 0;
		GeeIterator** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		GeeIterator* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
		GeeIterator** _tmp16_ = NULL;
		gint _tmp16__length1 = 0;
		_tmp3_ = forks;
		_tmp4_ = g_new0 (GeeIterator*, _tmp3_ + 1);
		_result_ = _tmp4_;
		_result__length1 = _tmp3_;
		__result__size_ = _result__length1;
		_tmp5_ = _result_;
		_tmp5__length1 = _result__length1;
		_tmp6_ = _g_object_ref0 ((GeeIterator*) self);
		_g_object_unref0 (_tmp5_[0]);
		_tmp5_[0] = _tmp6_;
		_tmp7_ = _tmp5_[0];
		{
			guint i = 0U;
			i = (guint) 1;
			{
				gboolean _tmp8_ = FALSE;
				_tmp8_ = TRUE;
				while (TRUE) {
					guint _tmp10_ = 0U;
					guint _tmp11_ = 0U;
					GeeIterator** _tmp12_ = NULL;
					gint _tmp12__length1 = 0;
					guint _tmp13_ = 0U;
					GeePriorityQueueIterator* _tmp14_ = NULL;
					GeeIterator* _tmp15_ = NULL;
					if (!_tmp8_) {
						guint _tmp9_ = 0U;
						_tmp9_ = i;
						i = _tmp9_ + 1;
					}
					_tmp8_ = FALSE;
					_tmp10_ = i;
					_tmp11_ = forks;
					if (!(_tmp10_ < _tmp11_)) {
						break;
					}
					_tmp12_ = _result_;
					_tmp12__length1 = _result__length1;
					_tmp13_ = i;
					_tmp14_ = gee_priority_queue_iterator_new_from_iterator (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
					_g_object_unref0 (_tmp12_[_tmp13_]);
					_tmp12_[_tmp13_] = (GeeIterator*) _tmp14_;
					_tmp15_ = _tmp12_[_tmp13_];
				}
			}
		}
		_tmp16_ = _result_;
		_tmp16__length1 = _result__length1;
		if (result_length1) {
			*result_length1 = _tmp16__length1;
		}
		result = _tmp16_;
		return result;
	}
}


static gboolean gee_priority_queue_iterator_real_get_read_only (GeeIterator* base) {
	gboolean result;
	GeePriorityQueueIterator* self;
	self = (GeePriorityQueueIterator*) base;
	result = FALSE;
	return result;
}


static gboolean gee_priority_queue_iterator_real_get_valid (GeeIterator* base) {
	gboolean result;
	GeePriorityQueueIterator* self;
	GeePriorityQueueNode* _tmp0_ = NULL;
	self = (GeePriorityQueueIterator*) base;
	_tmp0_ = self->position;
	result = _tmp0_ != NULL;
	return result;
}


static void gee_priority_queue_iterator_class_init (GeePriorityQueueIteratorClass * klass) {
	gee_priority_queue_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeePriorityQueueIteratorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_priority_queue_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_priority_queue_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_priority_queue_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static GType gee_priority_queue_iterator_gee_traversable_get_g_type (GeePriorityQueueIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_priority_queue_iterator_gee_traversable_get_g_dup_func (GeePriorityQueueIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_priority_queue_iterator_gee_traversable_get_g_destroy_func (GeePriorityQueueIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_priority_queue_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
	gee_priority_queue_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_priority_queue_iterator_real_foreach;
	iface->tee = (GeeIterator** (*)(GeeTraversable*, guint, int*)) gee_priority_queue_iterator_real_tee;
	iface->get_g_type = (GType(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_destroy_func;
}


static void gee_priority_queue_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
	gee_priority_queue_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*)(GeeIterator*)) gee_priority_queue_iterator_real_next;
	iface->has_next = (gboolean (*)(GeeIterator*)) gee_priority_queue_iterator_real_has_next;
	iface->get = (gpointer (*)(GeeIterator*)) gee_priority_queue_iterator_real_get;
	iface->remove = (void (*)(GeeIterator*)) gee_priority_queue_iterator_real_remove;
	iface->get_read_only = gee_priority_queue_iterator_real_get_read_only;
	iface->get_valid = gee_priority_queue_iterator_real_get_valid;
}


static void gee_priority_queue_iterator_instance_init (GeePriorityQueueIterator * self) {
	self->priv = GEE_PRIORITY_QUEUE_ITERATOR_GET_PRIVATE (self);
}


static void gee_priority_queue_iterator_finalize (GObject* obj) {
	GeePriorityQueueIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIterator);
	_g_object_unref0 (self->queue);
	G_OBJECT_CLASS (gee_priority_queue_iterator_parent_class)->finalize (obj);
}


static GType gee_priority_queue_iterator_get_type (void) {
	static volatile gsize gee_priority_queue_iterator_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_iterator_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueIterator), 0, (GInstanceInitFunc) gee_priority_queue_iterator_instance_init, NULL };
		static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_priority_queue_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_priority_queue_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_priority_queue_iterator_type_id;
		gee_priority_queue_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeePriorityQueueIterator", &g_define_type_info, 0);
		g_type_add_interface_static (gee_priority_queue_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
		g_type_add_interface_static (gee_priority_queue_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
		g_once_init_leave (&gee_priority_queue_iterator_type_id__volatile, gee_priority_queue_iterator_type_id);
	}
	return gee_priority_queue_iterator_type_id__volatile;
}


static void _vala_gee_priority_queue_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeePriorityQueueIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIterator);
	switch (property_id) {
		case GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		case GEE_PRIORITY_QUEUE_ITERATOR_VALID:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_priority_queue_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeePriorityQueueIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIterator);
	switch (property_id) {
		case GEE_PRIORITY_QUEUE_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_PRIORITY_QUEUE_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void gee_priority_queue_class_init (GeePriorityQueueClass * klass) {
	gee_priority_queue_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeePriorityQueuePrivate));
	((GeeAbstractQueueClass *) klass)->peek = gee_priority_queue_real_peek;
	((GeeAbstractQueueClass *) klass)->poll = gee_priority_queue_real_poll;
	((GeeAbstractCollectionClass *) klass)->contains = gee_priority_queue_real_contains;
	((GeeAbstractCollectionClass *) klass)->add = gee_priority_queue_real_add;
	((GeeAbstractCollectionClass *) klass)->remove = gee_priority_queue_real_remove;
	((GeeAbstractCollectionClass *) klass)->clear = gee_priority_queue_real_clear;
	((GeeAbstractCollectionClass *) klass)->iterator = gee_priority_queue_real_iterator;
	((GeeAbstractCollectionClass *) klass)->foreach = gee_priority_queue_real_foreach;
	GEE_ABSTRACT_QUEUE_CLASS (klass)->get_capacity = gee_priority_queue_real_get_capacity;
	GEE_ABSTRACT_QUEUE_CLASS (klass)->get_remaining_capacity = gee_priority_queue_real_get_remaining_capacity;
	GEE_ABSTRACT_QUEUE_CLASS (klass)->get_is_full = gee_priority_queue_real_get_is_full;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_priority_queue_real_get_read_only;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_priority_queue_real_get_size;
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_priority_queue_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_priority_queue_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_priority_queue_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_CAPACITY, g_param_spec_int ("capacity", "capacity", "capacity", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_REMAINING_CAPACITY, g_param_spec_int ("remaining-capacity", "remaining-capacity", "remaining-capacity", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_IS_FULL, g_param_spec_boolean ("is-full", "is-full", "is-full", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gee_priority_queue_instance_init (GeePriorityQueue * self) {
	GeePriorityQueueType1Node** _tmp0_ = NULL;
	gboolean* _tmp1_ = NULL;
	self->priv = GEE_PRIORITY_QUEUE_GET_PRIVATE (self);
	self->priv->_size = 0;
	self->priv->_stamp = 0;
	self->priv->_r = NULL;
	self->priv->_r_prime = NULL;
	self->priv->_lm_head = NULL;
	self->priv->_lm_tail = NULL;
	self->priv->_p = NULL;
	_tmp0_ = g_new0 (GeePriorityQueueType1Node*, 0 + 1);
	self->priv->_a = _tmp0_;
	self->priv->_a_length1 = 0;
	self->priv->__a_size_ = self->priv->_a_length1;
	self->priv->_lp_head = NULL;
	self->priv->_lp_tail = NULL;
	_tmp1_ = g_new0 (gboolean, 0);
	self->priv->_b = _tmp1_;
	self->priv->_b_length1 = 0;
	self->priv->__b_size_ = self->priv->_b_length1;
	self->priv->_ll_head = NULL;
	self->priv->_ll_tail = NULL;
	self->priv->_iter_head = NULL;
	self->priv->_iter_tail = NULL;
}


static void gee_priority_queue_finalize (GObject* obj) {
	GeePriorityQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue);
	_gee_priority_queue_node_unref0 (self->priv->_r);
	_gee_priority_queue_node_unref0 (self->priv->_r_prime);
	_gee_priority_queue_node_unref0 (self->priv->_lm_head);
	_gee_priority_queue_node_unref0 (self->priv->_lm_tail);
	_gee_priority_queue_node_unref0 (self->priv->_p);
	self->priv->_a = (_vala_array_free (self->priv->_a, self->priv->_a_length1, (GDestroyNotify) gee_priority_queue_node_unref), NULL);
	_gee_priority_queue_node_pair_free0 (self->priv->_lp_head);
	self->priv->_b = (g_free (self->priv->_b), NULL);
	_gee_priority_queue_node_unref0 (self->priv->_ll_head);
	_gee_priority_queue_node_unref0 (self->priv->_ll_tail);
	(self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL);
	self->priv->_compare_func = NULL;
	self->priv->_compare_func_target = NULL;
	self->priv->_compare_func_target_destroy_notify = NULL;
	G_OBJECT_CLASS (gee_priority_queue_parent_class)->finalize (obj);
}


/**
 * Relaxed fibonacci heap priority queue implementation of the {@link Queue}.
 *
 * The elements of the priority queue are ordered according to their natural
 * ordering, or by a compare_func provided at queue construction time. A
 * priority queue does not permit null elements and does not have bounded
 * capacity.
 *
 * This implementation provides O(1) time for offer and peek methods, and
 * O(log n) for poll method. It is based on the algorithms described by
 * Boyapati Chandra Sekhar in:
 *
 *   "Worst Case Efficient Data Structures
 *      for Priority Queues and Deques with Heap Order"
 *   Boyapati Chandra Sekhar (under the guidance of Prof. C. Pandu Rangan)
 *   Department of Computer Science and Engineering
 *   Indian Institute of Technology, Madras
 *   May 1996
 */
GType gee_priority_queue_get_type (void) {
	static volatile gsize gee_priority_queue_type_id__volatile = 0;
	if (g_once_init_enter (&gee_priority_queue_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueue), 0, (GInstanceInitFunc) gee_priority_queue_instance_init, NULL };
		GType gee_priority_queue_type_id;
		gee_priority_queue_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_QUEUE, "GeePriorityQueue", &g_define_type_info, 0);
		g_once_init_leave (&gee_priority_queue_type_id__volatile, gee_priority_queue_type_id);
	}
	return gee_priority_queue_type_id__volatile;
}


static void _vala_gee_priority_queue_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeePriorityQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue);
	switch (property_id) {
		case GEE_PRIORITY_QUEUE_CAPACITY:
		g_value_set_int (value, gee_abstract_queue_get_capacity ((GeeAbstractQueue*) self));
		break;
		case GEE_PRIORITY_QUEUE_REMAINING_CAPACITY:
		g_value_set_int (value, gee_abstract_queue_get_remaining_capacity ((GeeAbstractQueue*) self));
		break;
		case GEE_PRIORITY_QUEUE_IS_FULL:
		g_value_set_boolean (value, gee_abstract_queue_get_is_full ((GeeAbstractQueue*) self));
		break;
		case GEE_PRIORITY_QUEUE_READ_ONLY:
		g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
		break;
		case GEE_PRIORITY_QUEUE_SIZE:
		g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_priority_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeePriorityQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue);
	switch (property_id) {
		case GEE_PRIORITY_QUEUE_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_PRIORITY_QUEUE_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_PRIORITY_QUEUE_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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



