Blob Blame History Raw
/* treeset.c generated by valac 0.36.11, the Vala compiler
 * generated from treeset.vala, do not modify */

/* treeset.vala
 *
 * Copyright (C) 2009-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:
 * 	Maciej Piechotka <uzytkownik2@gmail.com>
 */

#include <glib.h>
#include <glib-object.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_SET (gee_set_get_type ())
#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))

typedef struct _GeeSet GeeSet;
typedef struct _GeeSetIface GeeSetIface;

#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ())
#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet))
#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET))
#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET))
#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))

typedef struct _GeeAbstractSet GeeAbstractSet;
typedef struct _GeeAbstractSetClass GeeAbstractSetClass;
typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate;

#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ())
#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet))
#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET))
#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface))

typedef struct _GeeSortedSet GeeSortedSet;
typedef struct _GeeSortedSetIface GeeSortedSetIface;

#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ())
#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet))
#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass))
#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET))
#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET))
#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass))

typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet;
typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass;
typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate;

#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ())
#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet))
#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET))
#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface))

typedef struct _GeeBidirSortedSet GeeBidirSortedSet;
typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface;

#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ())
#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator))
#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR))
#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface))

typedef struct _GeeBidirIterator GeeBidirIterator;
typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface;

#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ())
#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet))
#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass))
#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET))
#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET))
#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass))

typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet;
typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass;
typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate;

#define GEE_TYPE_TREE_SET (gee_tree_set_get_type ())
#define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet))
#define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass))
#define GEE_IS_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_SET))
#define GEE_IS_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_SET))
#define GEE_TREE_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_SET, GeeTreeSetClass))

typedef struct _GeeTreeSet GeeTreeSet;
typedef struct _GeeTreeSetClass GeeTreeSetClass;
typedef struct _GeeTreeSetPrivate GeeTreeSetPrivate;
typedef struct _GeeTreeSetNode GeeTreeSetNode;

#define GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE (gee_functions_compare_data_func_closure_get_type ())
#define GEE_FUNCTIONS_COMPARE_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE, GeeFunctionsCompareDataFuncClosure))
#define GEE_FUNCTIONS_COMPARE_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE, GeeFunctionsCompareDataFuncClosureClass))
#define GEE_FUNCTIONS_IS_COMPARE_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_IS_COMPARE_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_COMPARE_DATA_FUNC_CLOSURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_FUNCTIONS_TYPE_COMPARE_DATA_FUNC_CLOSURE, GeeFunctionsCompareDataFuncClosureClass))

typedef struct _GeeFunctionsCompareDataFuncClosure GeeFunctionsCompareDataFuncClosure;
typedef struct _GeeFunctionsCompareDataFuncClosureClass GeeFunctionsCompareDataFuncClosureClass;

#define GEE_TREE_SET_TYPE_RANGE_TYPE (gee_tree_set_range_type_get_type ())
#define _gee_tree_set_node_free0(var) ((var == NULL) ? NULL : (var = (gee_tree_set_node_free (var), NULL)))
#define _gee_functions_compare_data_func_closure_unref0(var) ((var == NULL) ? NULL : (var = (gee_functions_compare_data_func_closure_unref (var), NULL)))

#define GEE_TREE_SET_NODE_TYPE_COLOR (gee_tree_set_node_color_get_type ())

#define GEE_TREE_SET_TYPE_ITERATOR (gee_tree_set_iterator_get_type ())
#define GEE_TREE_SET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIterator))
#define GEE_TREE_SET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIteratorClass))
#define GEE_TREE_SET_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_SET_TYPE_ITERATOR))
#define GEE_TREE_SET_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_SET_TYPE_ITERATOR))
#define GEE_TREE_SET_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIteratorClass))

typedef struct _GeeTreeSetIterator GeeTreeSetIterator;
typedef struct _GeeTreeSetIteratorClass GeeTreeSetIteratorClass;

#define GEE_TREE_SET_TYPE_SUB_SET (gee_tree_set_sub_set_get_type ())
#define GEE_TREE_SET_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSet))
#define GEE_TREE_SET_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSetClass))
#define GEE_TREE_SET_IS_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_SET_TYPE_SUB_SET))
#define GEE_TREE_SET_IS_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_SET_TYPE_SUB_SET))
#define GEE_TREE_SET_SUB_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSetClass))

typedef struct _GeeTreeSetSubSet GeeTreeSetSubSet;
typedef struct _GeeTreeSetSubSetClass GeeTreeSetSubSetClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _GeeFunctionsCompareDataFuncClosurePrivate GeeFunctionsCompareDataFuncClosurePrivate;
typedef struct _GeeTreeSetIteratorPrivate GeeTreeSetIteratorPrivate;

#define GEE_TREE_SET_TYPE_RANGE (gee_tree_set_range_get_type ())
#define GEE_TREE_SET_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_SET_TYPE_RANGE, GeeTreeSetRange))
#define GEE_TREE_SET_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_SET_TYPE_RANGE, GeeTreeSetRangeClass))
#define GEE_TREE_SET_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_SET_TYPE_RANGE))
#define GEE_TREE_SET_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_SET_TYPE_RANGE))
#define GEE_TREE_SET_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_SET_TYPE_RANGE, GeeTreeSetRangeClass))

typedef struct _GeeTreeSetRange GeeTreeSetRange;
typedef struct _GeeTreeSetRangeClass GeeTreeSetRangeClass;
typedef struct _GeeTreeSetRangePrivate GeeTreeSetRangePrivate;
#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL)))
typedef struct _GeeTreeSetParamSpecRange GeeTreeSetParamSpecRange;
typedef struct _GeeTreeSetSubSetPrivate GeeTreeSetSubSetPrivate;
#define _gee_tree_set_range_unref0(var) ((var == NULL) ? NULL : (var = (gee_tree_set_range_unref (var), NULL)))

#define GEE_TREE_SET_TYPE_SUB_ITERATOR (gee_tree_set_sub_iterator_get_type ())
#define GEE_TREE_SET_SUB_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIterator))
#define GEE_TREE_SET_SUB_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIteratorClass))
#define GEE_TREE_SET_IS_SUB_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_SET_TYPE_SUB_ITERATOR))
#define GEE_TREE_SET_IS_SUB_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_SET_TYPE_SUB_ITERATOR))
#define GEE_TREE_SET_SUB_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIteratorClass))

typedef struct _GeeTreeSetSubIterator GeeTreeSetSubIterator;
typedef struct _GeeTreeSetSubIteratorClass GeeTreeSetSubIteratorClass;
typedef struct _GeeTreeSetSubIteratorPrivate GeeTreeSetSubIteratorPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (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);
	gpointer (*first_match) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	gboolean (*any_match) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	gboolean (*all_match) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	gpointer (*max) (GeeTraversable* self, GCompareDataFunc compare, void* compare_target, GDestroyNotify compare_target_destroy_notify);
	gpointer (*min) (GeeTraversable* self, GCompareDataFunc compare, void* compare_target, GDestroyNotify compare_target_destroy_notify);
	GeeIterator* (*order_by) (GeeTraversable* self, GCompareDataFunc compare, void* compare_target, GDestroyNotify compare_target_destroy_notify);
};

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 _GeeSetIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeSet* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
	GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
	GeeSet* (*get_read_only_view) (GeeSet* self);
};

struct _GeeAbstractSet {
	GeeAbstractCollection parent_instance;
	GeeAbstractSetPrivate * priv;
};

struct _GeeAbstractSetClass {
	GeeAbstractCollectionClass parent_class;
	void (*reserved0) (GeeAbstractSet* self);
	void (*reserved1) (GeeAbstractSet* self);
	void (*reserved2) (GeeAbstractSet* self);
	void (*reserved3) (GeeAbstractSet* self);
	void (*reserved4) (GeeAbstractSet* self);
	void (*reserved5) (GeeAbstractSet* self);
	void (*reserved6) (GeeAbstractSet* self);
	void (*reserved7) (GeeAbstractSet* self);
	void (*reserved8) (GeeAbstractSet* self);
	void (*reserved9) (GeeAbstractSet* self);
	GeeSet* (*get_read_only_view) (GeeAbstractSet* self);
};

struct _GeeSortedSetIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeSortedSet* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self);
	GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self);
	gpointer (*first) (GeeSortedSet* self);
	gpointer (*last) (GeeSortedSet* self);
	GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element);
	gpointer (*lower) (GeeSortedSet* self, gconstpointer element);
	gpointer (*higher) (GeeSortedSet* self, gconstpointer element);
	gpointer (*floor) (GeeSortedSet* self, gconstpointer element);
	gpointer (*ceil) (GeeSortedSet* self, gconstpointer element);
	GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before);
	GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after);
	GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to);
	GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self);
};

struct _GeeAbstractSortedSet {
	GeeAbstractSet parent_instance;
	GeeAbstractSortedSetPrivate * priv;
};

struct _GeeAbstractSortedSetClass {
	GeeAbstractSetClass parent_class;
	gpointer (*first) (GeeAbstractSortedSet* self);
	gpointer (*last) (GeeAbstractSortedSet* self);
	GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element);
	gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element);
	gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element);
	gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element);
	gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element);
	GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before);
	GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after);
	GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to);
	void (*reserved0) (GeeAbstractSortedSet* self);
	void (*reserved1) (GeeAbstractSortedSet* self);
	void (*reserved2) (GeeAbstractSortedSet* self);
	void (*reserved3) (GeeAbstractSortedSet* self);
	void (*reserved4) (GeeAbstractSortedSet* self);
	void (*reserved5) (GeeAbstractSortedSet* self);
	void (*reserved6) (GeeAbstractSortedSet* self);
	void (*reserved7) (GeeAbstractSortedSet* self);
	void (*reserved8) (GeeAbstractSortedSet* self);
	void (*reserved9) (GeeAbstractSortedSet* self);
	GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self);
};

struct _GeeBidirIteratorIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeBidirIterator* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self);
	GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self);
	gboolean (*previous) (GeeBidirIterator* self);
	gboolean (*has_previous) (GeeBidirIterator* self);
	gboolean (*first) (GeeBidirIterator* self);
	gboolean (*last) (GeeBidirIterator* self);
};

struct _GeeBidirSortedSetIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeBidirSortedSet* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self);
	GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self);
	GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self);
	GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self);
};

struct _GeeAbstractBidirSortedSet {
	GeeAbstractSortedSet parent_instance;
	GeeAbstractBidirSortedSetPrivate * priv;
};

struct _GeeAbstractBidirSortedSetClass {
	GeeAbstractSortedSetClass parent_class;
	GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self);
	void (*reserved0) (GeeAbstractBidirSortedSet* self);
	void (*reserved1) (GeeAbstractBidirSortedSet* self);
	void (*reserved2) (GeeAbstractBidirSortedSet* self);
	void (*reserved3) (GeeAbstractBidirSortedSet* self);
	void (*reserved4) (GeeAbstractBidirSortedSet* self);
	void (*reserved5) (GeeAbstractBidirSortedSet* self);
	void (*reserved6) (GeeAbstractBidirSortedSet* self);
	void (*reserved7) (GeeAbstractBidirSortedSet* self);
	void (*reserved8) (GeeAbstractBidirSortedSet* self);
	void (*reserved9) (GeeAbstractBidirSortedSet* self);
	GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self);
};

struct _GeeTreeSet {
	GeeAbstractBidirSortedSet parent_instance;
	GeeTreeSetPrivate * priv;
};

struct _GeeTreeSetClass {
	GeeAbstractBidirSortedSetClass parent_class;
};

struct _GeeTreeSetPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	gint _size;
	GeeTreeSetNode* root;
	GeeTreeSetNode* _first;
	GeeTreeSetNode* _last;
	gint stamp;
	GeeFunctionsCompareDataFuncClosure* _compare_func;
};

typedef enum  {
	GEE_TREE_SET_RANGE_TYPE_HEAD,
	GEE_TREE_SET_RANGE_TYPE_TAIL,
	GEE_TREE_SET_RANGE_TYPE_EMPTY,
	GEE_TREE_SET_RANGE_TYPE_BOUNDED
} GeeTreeSetRangeType;

typedef enum  {
	GEE_TREE_SET_NODE_COLOR_RED,
	GEE_TREE_SET_NODE_COLOR_BLACK
} GeeTreeSetNodeColor;

struct _GeeTreeSetNode {
	gpointer key;
	GeeTreeSetNodeColor color;
	GeeTreeSetNode* left;
	GeeTreeSetNode* right;
	GeeTreeSetNode* prev;
	GeeTreeSetNode* next;
};

struct _GeeFunctionsCompareDataFuncClosure {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeFunctionsCompareDataFuncClosurePrivate * priv;
	GCompareDataFunc func;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
};

struct _GeeFunctionsCompareDataFuncClosureClass {
	GTypeClass parent_class;
	void (*finalize) (GeeFunctionsCompareDataFuncClosure *self);
};

struct _GeeTreeSetIterator {
	GObject parent_instance;
	GeeTreeSetIteratorPrivate * priv;
	GeeTreeSet* _set;
	gint stamp;
	GeeTreeSetNode* _current;
	GeeTreeSetNode* _next;
	GeeTreeSetNode* _prev;
	gboolean started;
};

struct _GeeTreeSetIteratorClass {
	GObjectClass parent_class;
};

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

struct _GeeTreeSetRange {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeTreeSetRangePrivate * priv;
};

struct _GeeTreeSetRangeClass {
	GTypeClass parent_class;
	void (*finalize) (GeeTreeSetRange *self);
};

struct _GeeTreeSetRangePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeTreeSet* set;
	gpointer after;
	gpointer before;
	GeeTreeSetRangeType type;
};

struct _GeeTreeSetParamSpecRange {
	GParamSpec parent_instance;
};

struct _GeeTreeSetSubSet {
	GeeAbstractBidirSortedSet parent_instance;
	GeeTreeSetSubSetPrivate * priv;
	GeeTreeSet* set;
	GeeTreeSetRange* range;
};

struct _GeeTreeSetSubSetClass {
	GeeAbstractBidirSortedSetClass parent_class;
};

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

struct _GeeTreeSetSubIterator {
	GObject parent_instance;
	GeeTreeSetSubIteratorPrivate * priv;
	GeeTreeSet* set;
	GeeTreeSetRange* range;
	GeeTreeSetIterator* iterator;
};

struct _GeeTreeSetSubIteratorClass {
	GObjectClass parent_class;
};

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


static gpointer gee_tree_set_parent_class = NULL;
static gpointer gee_tree_set_iterator_parent_class = NULL;
static GeeTraversableIface * gee_tree_set_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface * gee_tree_set_iterator_gee_iterator_parent_iface = NULL;
static GeeBidirIteratorIface * gee_tree_set_iterator_gee_bidir_iterator_parent_iface = NULL;
static gpointer gee_tree_set_range_parent_class = NULL;
static gpointer gee_tree_set_sub_set_parent_class = NULL;
static gpointer gee_tree_set_sub_iterator_parent_class = NULL;
static GeeTraversableIface * gee_tree_set_sub_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface * gee_tree_set_sub_iterator_gee_iterator_parent_iface = NULL;
static GeeBidirIteratorIface * gee_tree_set_sub_iterator_gee_bidir_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_set_get_type (void) G_GNUC_CONST;
GType gee_abstract_set_get_type (void) G_GNUC_CONST;
GType gee_sorted_set_get_type (void) G_GNUC_CONST;
GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST;
GType gee_bidir_iterator_get_type (void) G_GNUC_CONST;
GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST;
GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST;
GType gee_tree_set_get_type (void) G_GNUC_CONST;
static void gee_tree_set_node_free (GeeTreeSetNode * self);
G_GNUC_INTERNAL gpointer gee_functions_compare_data_func_closure_ref (gpointer instance);
G_GNUC_INTERNAL void gee_functions_compare_data_func_closure_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_functions_param_spec_compare_data_func_closure (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
G_GNUC_INTERNAL void gee_functions_value_set_compare_data_func_closure (GValue* value, gpointer v_object) G_GNUC_UNUSED;
G_GNUC_INTERNAL void gee_functions_value_take_compare_data_func_closure (GValue* value, gpointer v_object);
G_GNUC_INTERNAL gpointer gee_functions_value_get_compare_data_func_closure (const GValue* value) G_GNUC_UNUSED;
G_GNUC_INTERNAL GType gee_functions_compare_data_func_closure_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GEE_TREE_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_TREE_SET, GeeTreeSetPrivate))
enum  {
	GEE_TREE_SET_0_PROPERTY,
	GEE_TREE_SET_G_TYPE,
	GEE_TREE_SET_G_DUP_FUNC,
	GEE_TREE_SET_G_DESTROY_FUNC,
	GEE_TREE_SET_SIZE_PROPERTY,
	GEE_TREE_SET_READ_ONLY_PROPERTY
};
void gee_abstract_collection_clear (GeeAbstractCollection* self);
static GType gee_tree_set_range_type_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
GeeTreeSet* gee_tree_set_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);
GeeTreeSet* gee_tree_set_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);
GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_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);
G_GNUC_INTERNAL GeeFunctionsCompareDataFuncClosure* gee_functions_compare_data_func_closure_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeFunctionsCompareDataFuncClosure* gee_functions_compare_data_func_closure_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeTreeSet* gee_tree_set_new_with_closures (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeFunctionsCompareDataFuncClosure* compare_func);
G_GNUC_INTERNAL GeeTreeSet* gee_tree_set_construct_with_closures (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeFunctionsCompareDataFuncClosure* compare_func);
static gboolean gee_tree_set_real_contains (GeeAbstractCollection* base, gconstpointer item);
GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target);
static GType gee_tree_set_node_color_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static inline void gee_tree_set_rotate_right (GeeTreeSet* self, GeeTreeSetNode* * root);
static inline void gee_tree_set_rotate_left (GeeTreeSet* self, GeeTreeSetNode* * root);
static inline gboolean gee_tree_set_is_red (GeeTreeSet* self, GeeTreeSetNode* n);
static inline gboolean gee_tree_set_is_black (GeeTreeSet* self, GeeTreeSetNode* n);
static inline void gee_tree_set_fix_up (GeeTreeSet* self, GeeTreeSetNode* * node);
static void gee_tree_set_node_flip (GeeTreeSetNode* self);
static gboolean gee_tree_set_add_to_node (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer item, GeeTreeSetNode* prev, GeeTreeSetNode* next);
static GeeTreeSetNode* gee_tree_set_node_new (gpointer node, GeeTreeSetNode* prev, GeeTreeSetNode* next);
static gboolean gee_tree_set_real_add (GeeAbstractCollection* base, gconstpointer item);
static inline void gee_tree_set_move_red_left (GeeTreeSet* self, GeeTreeSetNode* * root);
static inline void gee_tree_set_move_red_right (GeeTreeSet* self, GeeTreeSetNode* * root);
static inline void gee_tree_set_fix_removal (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer* key);
static void gee_tree_set_remove_minimal (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer* key);
static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* * node, gconstpointer item, GeeTreeSetNode* * prev, GeeTreeSetNode* * next);
static gboolean gee_tree_set_real_remove (GeeAbstractCollection* base, gconstpointer item);
static inline void gee_tree_set_clear_subtree (GeeTreeSet* self, GeeTreeSetNode* node);
static void gee_tree_set_real_clear (GeeAbstractCollection* base);
static gboolean gee_tree_set_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target);
static GeeIterator* gee_tree_set_real_iterator (GeeAbstractCollection* base);
static GeeTreeSetIterator* gee_tree_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set);
static GeeTreeSetIterator* gee_tree_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set);
static GType gee_tree_set_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base);
static inline gpointer gee_tree_set_lift_null_get (GeeTreeSet* self, GeeTreeSetNode* node);
static gpointer gee_tree_set_real_first (GeeAbstractSortedSet* base);
static gpointer gee_tree_set_real_last (GeeAbstractSortedSet* base);
static GeeSortedSet* gee_tree_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before);
static GeeTreeSetSubSet* gee_tree_set_sub_set_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before);
static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before);
static GType gee_tree_set_sub_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GeeSortedSet* gee_tree_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after);
static GeeTreeSetSubSet* gee_tree_set_sub_set_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after);
static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after);
static GeeSortedSet* gee_tree_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before);
static GeeTreeSetSubSet* gee_tree_set_sub_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before);
static GeeTreeSetSubSet* gee_tree_set_sub_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before);
static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpointer item);
static GeeIterator* gee_tree_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item);
static GeeTreeSetIterator* gee_tree_set_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current);
static GeeTreeSetIterator* gee_tree_set_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current);
static inline GeeTreeSetNode* gee_tree_set_find_nearest (GeeTreeSet* self, gconstpointer item);
static inline GeeTreeSetNode* gee_tree_set_find_lower (GeeTreeSet* self, gconstpointer item);
static inline GeeTreeSetNode* gee_tree_set_find_higher (GeeTreeSet* self, gconstpointer item);
static inline GeeTreeSetNode* gee_tree_set_find_floor (GeeTreeSet* self, gconstpointer item);
static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpointer item);
static gpointer gee_tree_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item);
static gpointer gee_tree_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item);
static gpointer gee_tree_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item);
static gpointer gee_tree_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item);
static inline gpointer gee_tree_set_min (GeeTreeSet* self, gconstpointer a, gconstpointer b);
static inline gpointer gee_tree_set_max (GeeTreeSet* self, gconstpointer a, gconstpointer b);
static void gee_tree_set_set_compare_func (GeeTreeSet* self, GCompareDataFunc value, gpointer value_target);
static void gee_tree_set_node_instance_init (GeeTreeSetNode * self);
static GeeTreeSetNodeColor gee_tree_set_node_color_flip (GeeTreeSetNodeColor self);
#define GEE_TREE_SET_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIteratorPrivate))
enum  {
	GEE_TREE_SET_ITERATOR_0_PROPERTY,
	GEE_TREE_SET_ITERATOR_G_TYPE,
	GEE_TREE_SET_ITERATOR_G_DUP_FUNC,
	GEE_TREE_SET_ITERATOR_G_DESTROY_FUNC,
	GEE_TREE_SET_ITERATOR_VALID_PROPERTY,
	GEE_TREE_SET_ITERATOR_READ_ONLY_PROPERTY
};
static GeeTreeSetIterator* gee_tree_set_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetIterator* iter);
static GeeTreeSetIterator* gee_tree_set_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetIterator* iter);
static gboolean gee_tree_set_iterator_real_next (GeeIterator* base);
static gboolean gee_tree_set_iterator_real_has_next (GeeIterator* base);
static gboolean gee_tree_set_iterator_real_first (GeeBidirIterator* base);
static gboolean gee_tree_set_iterator_real_previous (GeeBidirIterator* base);
static gboolean gee_tree_set_iterator_real_has_previous (GeeBidirIterator* base);
static gboolean gee_tree_set_iterator_real_last (GeeBidirIterator* base);
static gpointer gee_tree_set_iterator_real_get (GeeIterator* base);
static void gee_tree_set_iterator_real_remove (GeeIterator* base);
static gboolean gee_tree_set_iterator_safe_next_get (GeeTreeSetIterator* self, gpointer* val);
static gboolean gee_tree_set_iterator_safe_previous_get (GeeTreeSetIterator* self, gpointer* val);
static gboolean gee_tree_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
static GeeIterator** gee_tree_set_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1);
static void gee_tree_set_iterator_finalize (GObject * obj);
gboolean gee_iterator_get_valid (GeeIterator* self);
gboolean gee_iterator_get_read_only (GeeIterator* self);
static void _vala_gee_tree_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_tree_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static gpointer gee_tree_set_range_ref (gpointer instance);
static void gee_tree_set_range_unref (gpointer instance);
static GParamSpec* gee_tree_set_param_spec_range (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void gee_tree_set_value_set_range (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void gee_tree_set_value_take_range (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer gee_tree_set_value_get_range (const GValue* value) G_GNUC_UNUSED;
static GType gee_tree_set_range_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GEE_TREE_SET_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_SET_TYPE_RANGE, GeeTreeSetRangePrivate))
enum  {
	GEE_TREE_SET_RANGE_0_PROPERTY
};
static GeeTreeSetRange* gee_tree_set_range_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before);
static GeeTreeSetRange* gee_tree_set_range_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before);
static GeeTreeSetRange* gee_tree_set_range_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before);
static GeeTreeSetRange* gee_tree_set_range_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before);
static GeeTreeSetRange* gee_tree_set_range_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after);
static GeeTreeSetRange* gee_tree_set_range_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after);
static GeeTreeSetRange* gee_tree_set_range_cut_head (GeeTreeSetRange* self, gconstpointer after);
static GeeTreeSetRange* gee_tree_set_range_cut_tail (GeeTreeSetRange* self, gconstpointer before);
static GeeTreeSetRange* gee_tree_set_range_cut (GeeTreeSetRange* self, gconstpointer after, gconstpointer before);
static gboolean gee_tree_set_range_in_range (GeeTreeSetRange* self, gconstpointer item);
static gint gee_tree_set_range_compare_range (GeeTreeSetRange* self, gconstpointer item);
static gboolean gee_tree_set_range_empty_subset (GeeTreeSetRange* self);
static GeeTreeSetNode* gee_tree_set_range_first (GeeTreeSetRange* self);
static GeeTreeSetNode* gee_tree_set_range_last (GeeTreeSetRange* self);
static void gee_tree_set_range_finalize (GeeTreeSetRange * obj);
#define GEE_TREE_SET_SUB_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSetPrivate))
enum  {
	GEE_TREE_SET_SUB_SET_0_PROPERTY,
	GEE_TREE_SET_SUB_SET_G_TYPE,
	GEE_TREE_SET_SUB_SET_G_DUP_FUNC,
	GEE_TREE_SET_SUB_SET_G_DESTROY_FUNC,
	GEE_TREE_SET_SUB_SET_SIZE_PROPERTY,
	GEE_TREE_SET_SUB_SET_READ_ONLY_PROPERTY,
	GEE_TREE_SET_SUB_SET_IS_EMPTY_PROPERTY
};
static GeeTreeSetSubSet* gee_tree_set_sub_set_new_from_range (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range);
static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_from_range (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range);
static gboolean gee_tree_set_sub_set_real_contains (GeeAbstractCollection* base, gconstpointer item);
gboolean gee_abstract_collection_contains (GeeAbstractCollection* self, gconstpointer item);
static gboolean gee_tree_set_sub_set_real_add (GeeAbstractCollection* base, gconstpointer item);
gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item);
static gboolean gee_tree_set_sub_set_real_remove (GeeAbstractCollection* base, gconstpointer item);
gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpointer item);
static void gee_tree_set_sub_set_real_clear (GeeAbstractCollection* base);
GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self);
gboolean gee_iterator_next (GeeIterator* self);
void gee_iterator_remove (GeeIterator* self);
static GeeIterator* gee_tree_set_sub_set_real_iterator (GeeAbstractCollection* base);
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range);
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range);
static GType gee_tree_set_sub_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base);
static gpointer gee_tree_set_sub_set_real_first (GeeAbstractSortedSet* base);
static gpointer gee_tree_set_sub_set_real_last (GeeAbstractSortedSet* base);
static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before);
static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after);
static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before);
static GeeIterator* gee_tree_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item);
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node);
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node);
static gpointer gee_tree_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item);
gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self);
gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element);
static gpointer gee_tree_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item);
gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self);
gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element);
static gpointer gee_tree_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item);
gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element);
static gpointer gee_tree_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item);
gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element);
static gboolean gee_tree_set_sub_set_get_is_empty (GeeTreeSetSubSet* self);
static void gee_tree_set_sub_set_finalize (GObject * obj);
gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self);
static void _vala_gee_tree_set_sub_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_tree_set_sub_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
#define GEE_TREE_SET_SUB_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIteratorPrivate))
enum  {
	GEE_TREE_SET_SUB_ITERATOR_0_PROPERTY,
	GEE_TREE_SET_SUB_ITERATOR_G_TYPE,
	GEE_TREE_SET_SUB_ITERATOR_G_DUP_FUNC,
	GEE_TREE_SET_SUB_ITERATOR_G_DESTROY_FUNC,
	GEE_TREE_SET_SUB_ITERATOR_READ_ONLY_PROPERTY,
	GEE_TREE_SET_SUB_ITERATOR_VALID_PROPERTY
};
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetSubIterator* iter);
static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetSubIterator* iter);
static gboolean gee_tree_set_sub_iterator_real_next (GeeIterator* base);
gboolean gee_bidir_iterator_first (GeeBidirIterator* self);
static gboolean gee_tree_set_sub_iterator_real_has_next (GeeIterator* base);
static gboolean gee_tree_set_sub_iterator_real_first (GeeBidirIterator* base);
static gboolean gee_tree_set_sub_iterator_real_previous (GeeBidirIterator* base);
gboolean gee_bidir_iterator_previous (GeeBidirIterator* self);
static gboolean gee_tree_set_sub_iterator_real_has_previous (GeeBidirIterator* base);
static gboolean gee_tree_set_sub_iterator_real_last (GeeBidirIterator* base);
static gpointer gee_tree_set_sub_iterator_real_get (GeeIterator* base);
gpointer gee_iterator_get (GeeIterator* self);
static void gee_tree_set_sub_iterator_real_remove (GeeIterator* base);
static gboolean gee_tree_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
static GeeIterator** gee_tree_set_sub_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1);
static void gee_tree_set_sub_iterator_finalize (GObject * obj);
static void _vala_gee_tree_set_sub_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_tree_set_sub_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void gee_tree_set_finalize (GObject * obj);
static void _vala_gee_tree_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_tree_set_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);


static GType gee_tree_set_range_type_get_type (void) {
	static volatile gsize gee_tree_set_range_type_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_range_type_type_id__volatile)) {
		static const GEnumValue values[] = {{GEE_TREE_SET_RANGE_TYPE_HEAD, "GEE_TREE_SET_RANGE_TYPE_HEAD", "head"}, {GEE_TREE_SET_RANGE_TYPE_TAIL, "GEE_TREE_SET_RANGE_TYPE_TAIL", "tail"}, {GEE_TREE_SET_RANGE_TYPE_EMPTY, "GEE_TREE_SET_RANGE_TYPE_EMPTY", "empty"}, {GEE_TREE_SET_RANGE_TYPE_BOUNDED, "GEE_TREE_SET_RANGE_TYPE_BOUNDED", "bounded"}, {0, NULL, NULL}};
		GType gee_tree_set_range_type_type_id;
		gee_tree_set_range_type_type_id = g_enum_register_static ("GeeTreeSetRangeType", values);
		g_once_init_leave (&gee_tree_set_range_type_type_id__volatile, gee_tree_set_range_type_type_id);
	}
	return gee_tree_set_range_type_type_id__volatile;
}


/**
 * Constructs a new, empty tree set sorted according to the specified
 * comparator function.
 *
 * If not provided, the function parameter is requested to the
 * {@link Functions} function factory methods.
 *
 * @param compare_func an optional element comparator function
 */
GeeTreeSet* gee_tree_set_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) {
	GeeTreeSet * self = NULL;
	GCompareDataFunc _tmp0_;
	void* _tmp0__target;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	GDestroyNotify _tmp4__target_destroy_notify;
	GeeFunctionsCompareDataFuncClosure* _tmp5_;
	self = (GeeTreeSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_;
		GDestroyNotify _tmp2_;
		GCompareDataFunc _tmp3_;
		_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 = NULL;
	compare_func_target = NULL;
	compare_func_target_destroy_notify = NULL;
	_tmp5_ = gee_functions_compare_data_func_closure_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp4_, _tmp4__target, _tmp4__target_destroy_notify);
	_gee_functions_compare_data_func_closure_unref0 (self->priv->_compare_func);
	self->priv->_compare_func = _tmp5_;
	(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;
}


GeeTreeSet* gee_tree_set_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_tree_set_construct (GEE_TYPE_TREE_SET, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify);
}


G_GNUC_INTERNAL GeeTreeSet* gee_tree_set_construct_with_closures (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeFunctionsCompareDataFuncClosure* compare_func) {
	GeeTreeSet * self = NULL;
	GeeFunctionsCompareDataFuncClosure* _tmp0_;
	g_return_val_if_fail (compare_func != NULL, NULL);
	self = (GeeTreeSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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;
	compare_func = NULL;
	_gee_functions_compare_data_func_closure_unref0 (self->priv->_compare_func);
	self->priv->_compare_func = _tmp0_;
	_gee_functions_compare_data_func_closure_unref0 (compare_func);
	return self;
}


G_GNUC_INTERNAL GeeTreeSet* gee_tree_set_new_with_closures (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeFunctionsCompareDataFuncClosure* compare_func) {
	return gee_tree_set_construct_with_closures (GEE_TYPE_TREE_SET, g_type, g_dup_func, g_destroy_func, compare_func);
}


/**
 * {@inheritDoc}
 */
static gboolean gee_tree_set_real_contains (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSet * self;
	gboolean result = FALSE;
	GeeTreeSetNode* cur = NULL;
	GeeTreeSetNode* _tmp0_;
	self = (GeeTreeSet*) base;
	_tmp0_ = self->priv->root;
	cur = _tmp0_;
	while (TRUE) {
		GeeTreeSetNode* _tmp1_;
		gint res = 0;
		GCompareDataFunc _tmp2_;
		void* _tmp2__target;
		GCompareDataFunc _tmp3_;
		void* _tmp3__target;
		gconstpointer _tmp4_;
		GeeTreeSetNode* _tmp5_;
		gconstpointer _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp1_ = cur;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target);
		_tmp3_ = _tmp2_;
		_tmp3__target = _tmp2__target;
		_tmp4_ = item;
		_tmp5_ = cur;
		_tmp6_ = _tmp5_->key;
		_tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target);
		res = _tmp7_;
		_tmp8_ = res;
		if (_tmp8_ == 0) {
			result = TRUE;
			return result;
		} else {
			gint _tmp9_;
			_tmp9_ = res;
			if (_tmp9_ < 0) {
				GeeTreeSetNode* _tmp10_;
				GeeTreeSetNode* _tmp11_;
				_tmp10_ = cur;
				_tmp11_ = _tmp10_->left;
				cur = _tmp11_;
			} else {
				GeeTreeSetNode* _tmp12_;
				GeeTreeSetNode* _tmp13_;
				_tmp12_ = cur;
				_tmp13_ = _tmp12_->right;
				cur = _tmp13_;
			}
		}
	}
	result = FALSE;
	return result;
}


static inline void gee_tree_set_rotate_right (GeeTreeSet* self, GeeTreeSetNode* * root) {
	GeeTreeSetNode* pivot = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNodeColor _tmp4_;
	GeeTreeSetNode* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	GeeTreeSetNode* _tmp7_;
	GeeTreeSetNode* _tmp8_;
	GeeTreeSetNode* _tmp9_;
	GeeTreeSetNode* _tmp10_;
	GeeTreeSetNode* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*root != NULL);
	_tmp0_ = *root;
	_tmp1_ = _tmp0_->left;
	_tmp0_->left = NULL;
	pivot = _tmp1_;
	_tmp2_ = pivot;
	_tmp3_ = *root;
	_tmp4_ = _tmp3_->color;
	_tmp2_->color = _tmp4_;
	_tmp5_ = *root;
	_tmp5_->color = GEE_TREE_SET_NODE_COLOR_RED;
	_tmp6_ = *root;
	_tmp7_ = pivot;
	_tmp8_ = _tmp7_->right;
	_tmp7_->right = NULL;
	_gee_tree_set_node_free0 (_tmp6_->left);
	_tmp6_->left = _tmp8_;
	_tmp9_ = pivot;
	_tmp10_ = *root;
	*root = NULL;
	_gee_tree_set_node_free0 (_tmp9_->right);
	_tmp9_->right = _tmp10_;
	_tmp11_ = pivot;
	pivot = NULL;
	_gee_tree_set_node_free0 (*root);
	*root = _tmp11_;
	_gee_tree_set_node_free0 (pivot);
}


static inline void gee_tree_set_rotate_left (GeeTreeSet* self, GeeTreeSetNode* * root) {
	GeeTreeSetNode* pivot = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNodeColor _tmp4_;
	GeeTreeSetNode* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	GeeTreeSetNode* _tmp7_;
	GeeTreeSetNode* _tmp8_;
	GeeTreeSetNode* _tmp9_;
	GeeTreeSetNode* _tmp10_;
	GeeTreeSetNode* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*root != NULL);
	_tmp0_ = *root;
	_tmp1_ = _tmp0_->right;
	_tmp0_->right = NULL;
	pivot = _tmp1_;
	_tmp2_ = pivot;
	_tmp3_ = *root;
	_tmp4_ = _tmp3_->color;
	_tmp2_->color = _tmp4_;
	_tmp5_ = *root;
	_tmp5_->color = GEE_TREE_SET_NODE_COLOR_RED;
	_tmp6_ = *root;
	_tmp7_ = pivot;
	_tmp8_ = _tmp7_->left;
	_tmp7_->left = NULL;
	_gee_tree_set_node_free0 (_tmp6_->right);
	_tmp6_->right = _tmp8_;
	_tmp9_ = pivot;
	_tmp10_ = *root;
	*root = NULL;
	_gee_tree_set_node_free0 (_tmp9_->left);
	_tmp9_->left = _tmp10_;
	_tmp11_ = pivot;
	pivot = NULL;
	_gee_tree_set_node_free0 (*root);
	*root = _tmp11_;
	_gee_tree_set_node_free0 (pivot);
}


static inline gboolean gee_tree_set_is_red (GeeTreeSet* self, GeeTreeSetNode* n) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetNode* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = n;
	if (_tmp1_ != NULL) {
		GeeTreeSetNode* _tmp2_;
		GeeTreeSetNodeColor _tmp3_;
		_tmp2_ = n;
		_tmp3_ = _tmp2_->color;
		_tmp0_ = _tmp3_ == GEE_TREE_SET_NODE_COLOR_RED;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


static inline gboolean gee_tree_set_is_black (GeeTreeSet* self, GeeTreeSetNode* n) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetNode* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = n;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GeeTreeSetNode* _tmp2_;
		GeeTreeSetNodeColor _tmp3_;
		_tmp2_ = n;
		_tmp3_ = _tmp2_->color;
		_tmp0_ = _tmp3_ == GEE_TREE_SET_NODE_COLOR_BLACK;
	}
	result = _tmp0_;
	return result;
}


static inline void gee_tree_set_fix_up (GeeTreeSet* self, GeeTreeSetNode* * node) {
	gboolean _tmp0_ = FALSE;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp7_ = FALSE;
	GeeTreeSetNode* _tmp8_;
	GeeTreeSetNode* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp15_ = FALSE;
	GeeTreeSetNode* _tmp16_;
	GeeTreeSetNode* _tmp17_;
	gboolean _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*node != NULL);
	_tmp1_ = *node;
	_tmp2_ = _tmp1_->left;
	_tmp3_ = gee_tree_set_is_black (self, _tmp2_);
	if (_tmp3_) {
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetNode* _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = *node;
		_tmp5_ = _tmp4_->right;
		_tmp6_ = gee_tree_set_is_red (self, _tmp5_);
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gee_tree_set_rotate_left (self, node);
	}
	_tmp8_ = *node;
	_tmp9_ = _tmp8_->left;
	_tmp10_ = gee_tree_set_is_red (self, _tmp9_);
	if (_tmp10_) {
		GeeTreeSetNode* _tmp11_;
		GeeTreeSetNode* _tmp12_;
		GeeTreeSetNode* _tmp13_;
		gboolean _tmp14_;
		_tmp11_ = *node;
		_tmp12_ = _tmp11_->left;
		_tmp13_ = _tmp12_->left;
		_tmp14_ = gee_tree_set_is_red (self, _tmp13_);
		_tmp7_ = _tmp14_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		gee_tree_set_rotate_right (self, node);
	}
	_tmp16_ = *node;
	_tmp17_ = _tmp16_->left;
	_tmp18_ = gee_tree_set_is_red (self, _tmp17_);
	if (_tmp18_) {
		GeeTreeSetNode* _tmp19_;
		GeeTreeSetNode* _tmp20_;
		gboolean _tmp21_;
		_tmp19_ = *node;
		_tmp20_ = _tmp19_->right;
		_tmp21_ = gee_tree_set_is_red (self, _tmp20_);
		_tmp15_ = _tmp21_;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		GeeTreeSetNode* _tmp22_;
		_tmp22_ = *node;
		gee_tree_set_node_flip (_tmp22_);
	}
}


static gboolean gee_tree_set_add_to_node (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer item, GeeTreeSetNode* prev, GeeTreeSetNode* next) {
	gboolean result = FALSE;
	GeeTreeSetNode* _tmp0_;
	gint cmp = 0;
	GCompareDataFunc _tmp10_;
	void* _tmp10__target;
	GCompareDataFunc _tmp11_;
	void* _tmp11__target;
	gconstpointer _tmp12_;
	GeeTreeSetNode* _tmp13_;
	gconstpointer _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = *node;
	if (_tmp0_ == NULL) {
		gpointer _tmp1_;
		GeeTreeSetNode* _tmp2_;
		GeeTreeSetNode* _tmp3_;
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetNode* _tmp5_;
		GeeTreeSetNode* _tmp7_;
		gint _tmp9_;
		_tmp1_ = item;
		item = NULL;
		_tmp2_ = prev;
		_tmp3_ = next;
		_tmp4_ = gee_tree_set_node_new (_tmp1_, _tmp2_, _tmp3_);
		_gee_tree_set_node_free0 (*node);
		*node = _tmp4_;
		_tmp5_ = prev;
		if (_tmp5_ == NULL) {
			GeeTreeSetNode* _tmp6_;
			_tmp6_ = *node;
			self->priv->_first = _tmp6_;
		}
		_tmp7_ = next;
		if (_tmp7_ == NULL) {
			GeeTreeSetNode* _tmp8_;
			_tmp8_ = *node;
			self->priv->_last = _tmp8_;
		}
		_tmp9_ = self->priv->_size;
		self->priv->_size = _tmp9_ + 1;
		result = TRUE;
		((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
		return result;
	}
	_tmp10_ = gee_tree_set_get_compare_func (self, &_tmp10__target);
	_tmp11_ = _tmp10_;
	_tmp11__target = _tmp10__target;
	_tmp12_ = item;
	_tmp13_ = *node;
	_tmp14_ = _tmp13_->key;
	_tmp15_ = _tmp11_ (_tmp12_, _tmp14_, _tmp11__target);
	cmp = _tmp15_;
	_tmp16_ = cmp;
	if (_tmp16_ == 0) {
		gee_tree_set_fix_up (self, node);
		result = FALSE;
		((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
		return result;
	} else {
		gint _tmp17_;
		_tmp17_ = cmp;
		if (_tmp17_ < 0) {
			gboolean r = FALSE;
			GeeTreeSetNode* _tmp18_;
			gconstpointer _tmp19_;
			gpointer _tmp20_;
			GeeTreeSetNode* _tmp21_;
			GeeTreeSetNode* _tmp22_;
			GeeTreeSetNode* _tmp23_;
			gboolean _tmp24_;
			_tmp18_ = *node;
			_tmp19_ = item;
			_tmp20_ = ((_tmp19_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp19_) : ((gpointer) _tmp19_);
			_tmp21_ = *node;
			_tmp22_ = _tmp21_->prev;
			_tmp23_ = *node;
			_tmp24_ = gee_tree_set_add_to_node (self, &_tmp18_->left, _tmp20_, _tmp22_, _tmp23_);
			r = _tmp24_;
			gee_tree_set_fix_up (self, node);
			result = r;
			((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
			return result;
		} else {
			gboolean r = FALSE;
			GeeTreeSetNode* _tmp25_;
			gconstpointer _tmp26_;
			gpointer _tmp27_;
			GeeTreeSetNode* _tmp28_;
			GeeTreeSetNode* _tmp29_;
			GeeTreeSetNode* _tmp30_;
			gboolean _tmp31_;
			_tmp25_ = *node;
			_tmp26_ = item;
			_tmp27_ = ((_tmp26_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp26_) : ((gpointer) _tmp26_);
			_tmp28_ = *node;
			_tmp29_ = *node;
			_tmp30_ = _tmp29_->next;
			_tmp31_ = gee_tree_set_add_to_node (self, &_tmp25_->right, _tmp27_, _tmp28_, _tmp30_);
			r = _tmp31_;
			gee_tree_set_fix_up (self, node);
			result = r;
			((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
			return result;
		}
	}
	((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
}


/**
 * {@inheritDoc}
 *
 * If the element already exists in the set it will not be added twice.
 */
static gboolean gee_tree_set_real_add (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSet * self;
	gboolean result = FALSE;
	gboolean r = FALSE;
	gconstpointer _tmp0_;
	gpointer _tmp1_;
	gboolean _tmp2_;
	GeeTreeSetNode* _tmp3_;
	gint _tmp4_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = ((_tmp0_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	_tmp2_ = gee_tree_set_add_to_node (self, &self->priv->root, _tmp1_, NULL, NULL);
	r = _tmp2_;
	_tmp3_ = self->priv->root;
	_tmp3_->color = GEE_TREE_SET_NODE_COLOR_BLACK;
	_tmp4_ = self->priv->stamp;
	self->priv->stamp = _tmp4_ + 1;
	result = r;
	return result;
}


static inline void gee_tree_set_move_red_left (GeeTreeSet* self, GeeTreeSetNode* * root) {
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*root != NULL);
	_tmp0_ = *root;
	gee_tree_set_node_flip (_tmp0_);
	_tmp1_ = *root;
	_tmp2_ = _tmp1_->right;
	_tmp3_ = _tmp2_->left;
	_tmp4_ = gee_tree_set_is_red (self, _tmp3_);
	if (_tmp4_) {
		GeeTreeSetNode* _tmp5_;
		GeeTreeSetNode* _tmp6_;
		_tmp5_ = *root;
		gee_tree_set_rotate_right (self, &_tmp5_->right);
		gee_tree_set_rotate_left (self, root);
		_tmp6_ = *root;
		gee_tree_set_node_flip (_tmp6_);
	}
}


static inline void gee_tree_set_move_red_right (GeeTreeSet* self, GeeTreeSetNode* * root) {
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*root != NULL);
	_tmp0_ = *root;
	gee_tree_set_node_flip (_tmp0_);
	_tmp1_ = *root;
	_tmp2_ = _tmp1_->left;
	_tmp3_ = _tmp2_->left;
	_tmp4_ = gee_tree_set_is_red (self, _tmp3_);
	if (_tmp4_) {
		GeeTreeSetNode* _tmp5_;
		gee_tree_set_rotate_right (self, root);
		_tmp5_ = *root;
		gee_tree_set_node_flip (_tmp5_);
	}
}


static inline void gee_tree_set_fix_removal (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer* key) {
	gpointer _vala_key = NULL;
	GeeTreeSetNode* n = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp2_;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetNode* _tmp11_;
	GeeTreeSetNode* _tmp12_;
	gint _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*node != NULL);
	_tmp0_ = *node;
	*node = NULL;
	n = _tmp0_;
	_tmp1_ = n;
	_tmp2_ = _tmp1_->key;
	_tmp1_->key = NULL;
	((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
	_vala_key = _tmp2_;
	_tmp3_ = n;
	_tmp4_ = _tmp3_->prev;
	if (_tmp4_ != NULL) {
		GeeTreeSetNode* _tmp5_;
		GeeTreeSetNode* _tmp6_;
		GeeTreeSetNode* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		_tmp5_ = n;
		_tmp6_ = _tmp5_->prev;
		_tmp7_ = n;
		_tmp8_ = _tmp7_->next;
		_tmp6_->next = _tmp8_;
	} else {
		GeeTreeSetNode* _tmp9_;
		GeeTreeSetNode* _tmp10_;
		_tmp9_ = n;
		_tmp10_ = _tmp9_->next;
		self->priv->_first = _tmp10_;
	}
	_tmp11_ = n;
	_tmp12_ = _tmp11_->next;
	if (_tmp12_ != NULL) {
		GeeTreeSetNode* _tmp13_;
		GeeTreeSetNode* _tmp14_;
		GeeTreeSetNode* _tmp15_;
		GeeTreeSetNode* _tmp16_;
		_tmp13_ = n;
		_tmp14_ = _tmp13_->next;
		_tmp15_ = n;
		_tmp16_ = _tmp15_->prev;
		_tmp14_->prev = _tmp16_;
	} else {
		GeeTreeSetNode* _tmp17_;
		GeeTreeSetNode* _tmp18_;
		_tmp17_ = n;
		_tmp18_ = _tmp17_->prev;
		self->priv->_last = _tmp18_;
	}
	_gee_tree_set_node_free0 (*node);
	*node = NULL;
	_tmp19_ = self->priv->_size;
	self->priv->_size = _tmp19_ - 1;
	_gee_tree_set_node_free0 (n);
	if (key) {
		*key = _vala_key;
	} else {
		((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
	}
}


static void gee_tree_set_remove_minimal (GeeTreeSet* self, GeeTreeSetNode* * node, gpointer* key) {
	gpointer _vala_key = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gboolean _tmp3_ = FALSE;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetNode* _tmp5_;
	gboolean _tmp6_;
	GeeTreeSetNode* _tmp11_;
	gpointer _tmp12_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*node != NULL);
	_tmp0_ = *node;
	_tmp1_ = _tmp0_->left;
	if (_tmp1_ == NULL) {
		gpointer _tmp2_ = NULL;
		gee_tree_set_fix_removal (self, node, &_tmp2_);
		((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
		_vala_key = _tmp2_;
		if (key) {
			*key = _vala_key;
		} else {
			((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
		}
		return;
	}
	_tmp4_ = *node;
	_tmp5_ = _tmp4_->left;
	_tmp6_ = gee_tree_set_is_black (self, _tmp5_);
	if (_tmp6_) {
		GeeTreeSetNode* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		GeeTreeSetNode* _tmp9_;
		gboolean _tmp10_;
		_tmp7_ = *node;
		_tmp8_ = _tmp7_->left;
		_tmp9_ = _tmp8_->left;
		_tmp10_ = gee_tree_set_is_black (self, _tmp9_);
		_tmp3_ = _tmp10_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		gee_tree_set_move_red_left (self, node);
	}
	_tmp11_ = *node;
	gee_tree_set_remove_minimal (self, &_tmp11_->left, &_tmp12_);
	((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
	_vala_key = _tmp12_;
	gee_tree_set_fix_up (self, node);
	if (key) {
		*key = _vala_key;
	} else {
		((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL));
	}
}


static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* * node, gconstpointer item, GeeTreeSetNode* * prev, GeeTreeSetNode* * next) {
	GeeTreeSetNode* _vala_prev = NULL;
	GeeTreeSetNode* _vala_next = NULL;
	gboolean result = FALSE;
	GeeTreeSetNode* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = *node;
	if (_tmp0_ == NULL) {
		_vala_prev = NULL;
		_vala_next = NULL;
		result = FALSE;
		if (prev) {
			*prev = _vala_prev;
		}
		if (next) {
			*next = _vala_next;
		}
		return result;
	} else {
		GCompareDataFunc _tmp1_;
		void* _tmp1__target;
		GCompareDataFunc _tmp2_;
		void* _tmp2__target;
		gconstpointer _tmp3_;
		GeeTreeSetNode* _tmp4_;
		gconstpointer _tmp5_;
		gint _tmp6_;
		_tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target);
		_tmp2_ = _tmp1_;
		_tmp2__target = _tmp1__target;
		_tmp3_ = item;
		_tmp4_ = *node;
		_tmp5_ = _tmp4_->key;
		_tmp6_ = _tmp2_ (_tmp3_, _tmp5_, _tmp2__target);
		if (_tmp6_ < 0) {
			GeeTreeSetNode* left = NULL;
			GeeTreeSetNode* _tmp7_;
			GeeTreeSetNode* _tmp8_;
			GeeTreeSetNode* _tmp9_;
			gboolean _tmp10_ = FALSE;
			GeeTreeSetNode* _tmp11_;
			gboolean _tmp12_;
			gboolean r = FALSE;
			GeeTreeSetNode* _tmp16_;
			gconstpointer _tmp17_;
			GeeTreeSetNode* _tmp18_ = NULL;
			GeeTreeSetNode* _tmp19_ = NULL;
			gboolean _tmp20_;
			_tmp7_ = *node;
			_tmp8_ = _tmp7_->left;
			left = _tmp8_;
			_tmp9_ = left;
			if (_tmp9_ == NULL) {
				_vala_prev = NULL;
				_vala_next = NULL;
				result = FALSE;
				if (prev) {
					*prev = _vala_prev;
				}
				if (next) {
					*next = _vala_next;
				}
				return result;
			}
			_tmp11_ = left;
			_tmp12_ = gee_tree_set_is_black (self, _tmp11_);
			if (_tmp12_) {
				GeeTreeSetNode* _tmp13_;
				GeeTreeSetNode* _tmp14_;
				gboolean _tmp15_;
				_tmp13_ = left;
				_tmp14_ = _tmp13_->left;
				_tmp15_ = gee_tree_set_is_black (self, _tmp14_);
				_tmp10_ = _tmp15_;
			} else {
				_tmp10_ = FALSE;
			}
			if (_tmp10_) {
				gee_tree_set_move_red_left (self, node);
			}
			_tmp16_ = *node;
			_tmp17_ = item;
			_tmp20_ = gee_tree_set_remove_from_node (self, &_tmp16_->left, _tmp17_, &_tmp18_, &_tmp19_);
			_vala_prev = _tmp18_;
			_vala_next = _tmp19_;
			r = _tmp20_;
			gee_tree_set_fix_up (self, node);
			result = r;
			if (prev) {
				*prev = _vala_prev;
			}
			if (next) {
				*next = _vala_next;
			}
			return result;
		} else {
			GeeTreeSetNode* _tmp21_;
			GeeTreeSetNode* _tmp22_;
			gboolean _tmp23_;
			GeeTreeSetNode* r = NULL;
			GeeTreeSetNode* _tmp24_;
			GeeTreeSetNode* _tmp25_;
			gboolean _tmp26_ = FALSE;
			GCompareDataFunc _tmp27_;
			void* _tmp27__target;
			GCompareDataFunc _tmp28_;
			void* _tmp28__target;
			gconstpointer _tmp29_;
			GeeTreeSetNode* _tmp30_;
			gconstpointer _tmp31_;
			gint _tmp32_;
			gboolean _tmp38_ = FALSE;
			gboolean _tmp39_ = FALSE;
			GeeTreeSetNode* _tmp40_;
			gboolean _tmp41_;
			GCompareDataFunc _tmp46_;
			void* _tmp46__target;
			GCompareDataFunc _tmp47_;
			void* _tmp47__target;
			gconstpointer _tmp48_;
			GeeTreeSetNode* _tmp49_;
			gconstpointer _tmp50_;
			gint _tmp51_;
			_tmp21_ = *node;
			_tmp22_ = _tmp21_->left;
			_tmp23_ = gee_tree_set_is_red (self, _tmp22_);
			if (_tmp23_) {
				gee_tree_set_rotate_right (self, node);
			}
			_tmp24_ = *node;
			_tmp25_ = _tmp24_->right;
			r = _tmp25_;
			_tmp27_ = gee_tree_set_get_compare_func (self, &_tmp27__target);
			_tmp28_ = _tmp27_;
			_tmp28__target = _tmp27__target;
			_tmp29_ = item;
			_tmp30_ = *node;
			_tmp31_ = _tmp30_->key;
			_tmp32_ = _tmp28_ (_tmp29_, _tmp31_, _tmp28__target);
			if (_tmp32_ == 0) {
				GeeTreeSetNode* _tmp33_;
				_tmp33_ = r;
				_tmp26_ = _tmp33_ == NULL;
			} else {
				_tmp26_ = FALSE;
			}
			if (_tmp26_) {
				GeeTreeSetNode* _tmp34_;
				GeeTreeSetNode* _tmp35_;
				GeeTreeSetNode* _tmp36_;
				GeeTreeSetNode* _tmp37_;
				_tmp34_ = *node;
				_tmp35_ = _tmp34_->prev;
				_vala_prev = _tmp35_;
				_tmp36_ = *node;
				_tmp37_ = _tmp36_->next;
				_vala_next = _tmp37_;
				gee_tree_set_fix_removal (self, node, NULL);
				result = TRUE;
				if (prev) {
					*prev = _vala_prev;
				}
				if (next) {
					*next = _vala_next;
				}
				return result;
			}
			_tmp40_ = r;
			_tmp41_ = gee_tree_set_is_black (self, _tmp40_);
			if (_tmp41_) {
				GeeTreeSetNode* _tmp42_;
				_tmp42_ = r;
				_tmp39_ = _tmp42_ != NULL;
			} else {
				_tmp39_ = FALSE;
			}
			if (_tmp39_) {
				GeeTreeSetNode* _tmp43_;
				GeeTreeSetNode* _tmp44_;
				gboolean _tmp45_;
				_tmp43_ = r;
				_tmp44_ = _tmp43_->left;
				_tmp45_ = gee_tree_set_is_black (self, _tmp44_);
				_tmp38_ = _tmp45_;
			} else {
				_tmp38_ = FALSE;
			}
			if (_tmp38_) {
				gee_tree_set_move_red_right (self, node);
			}
			_tmp46_ = gee_tree_set_get_compare_func (self, &_tmp46__target);
			_tmp47_ = _tmp46_;
			_tmp47__target = _tmp46__target;
			_tmp48_ = item;
			_tmp49_ = *node;
			_tmp50_ = _tmp49_->key;
			_tmp51_ = _tmp47_ (_tmp48_, _tmp50_, _tmp47__target);
			if (_tmp51_ == 0) {
				GeeTreeSetNode* _tmp52_;
				GeeTreeSetNode* _tmp53_;
				GeeTreeSetNode* _tmp54_;
				GeeTreeSetNode* _tmp55_;
				GeeTreeSetNode* _tmp56_;
				gpointer _tmp57_ = NULL;
				_tmp52_ = *node;
				_tmp53_ = _tmp52_->prev;
				_vala_prev = _tmp53_;
				_tmp54_ = *node;
				_vala_next = _tmp54_;
				_tmp55_ = *node;
				_tmp56_ = *node;
				gee_tree_set_remove_minimal (self, &_tmp55_->right, &_tmp57_);
				((_tmp56_->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp56_->key = (self->priv->g_destroy_func (_tmp56_->key), NULL));
				_tmp56_->key = _tmp57_;
				gee_tree_set_fix_up (self, node);
				result = TRUE;
				if (prev) {
					*prev = _vala_prev;
				}
				if (next) {
					*next = _vala_next;
				}
				return result;
			} else {
				gboolean re = FALSE;
				GeeTreeSetNode* _tmp58_;
				gconstpointer _tmp59_;
				GeeTreeSetNode* _tmp60_ = NULL;
				GeeTreeSetNode* _tmp61_ = NULL;
				gboolean _tmp62_;
				_tmp58_ = *node;
				_tmp59_ = item;
				_tmp62_ = gee_tree_set_remove_from_node (self, &_tmp58_->right, _tmp59_, &_tmp60_, &_tmp61_);
				_vala_prev = _tmp60_;
				_vala_next = _tmp61_;
				re = _tmp62_;
				gee_tree_set_fix_up (self, node);
				result = re;
				if (prev) {
					*prev = _vala_prev;
				}
				if (next) {
					*next = _vala_next;
				}
				return result;
			}
		}
	}
	if (prev) {
		*prev = _vala_prev;
	}
	if (next) {
		*next = _vala_next;
	}
}


/**
 * {@inheritDoc}
 */
static gboolean gee_tree_set_real_remove (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSet * self;
	gboolean result = FALSE;
	gboolean b = FALSE;
	gconstpointer _tmp0_;
	gboolean _tmp1_;
	GeeTreeSetNode* _tmp2_;
	gint _tmp4_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_remove_from_node (self, &self->priv->root, _tmp0_, NULL, NULL);
	b = _tmp1_;
	_tmp2_ = self->priv->root;
	if (_tmp2_ != NULL) {
		GeeTreeSetNode* _tmp3_;
		_tmp3_ = self->priv->root;
		_tmp3_->color = GEE_TREE_SET_NODE_COLOR_BLACK;
	}
	_tmp4_ = self->priv->stamp;
	self->priv->stamp = _tmp4_ + 1;
	result = b;
	return result;
}


static inline void gee_tree_set_clear_subtree (GeeTreeSet* self, GeeTreeSetNode* node) {
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node;
	((_tmp0_->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp0_->key = (self->priv->g_destroy_func (_tmp0_->key), NULL));
	_tmp0_->key = NULL;
	_tmp1_ = node;
	_tmp2_ = _tmp1_->left;
	if (_tmp2_ != NULL) {
		GeeTreeSetNode* _tmp3_;
		GeeTreeSetNode* _tmp4_;
		_tmp3_ = node;
		_tmp4_ = _tmp3_->left;
		_tmp3_->left = NULL;
		gee_tree_set_clear_subtree (self, _tmp4_);
	}
	_tmp5_ = node;
	_tmp6_ = _tmp5_->right;
	if (_tmp6_ != NULL) {
		GeeTreeSetNode* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		_tmp7_ = node;
		_tmp8_ = _tmp7_->right;
		_tmp7_->right = NULL;
		gee_tree_set_clear_subtree (self, _tmp8_);
	}
	_gee_tree_set_node_free0 (node);
}


/**
 * {@inheritDoc}
 */
static void gee_tree_set_real_clear (GeeAbstractCollection* base) {
	GeeTreeSet * self;
	GeeTreeSetNode* _tmp0_;
	gint _tmp3_;
	self = (GeeTreeSet*) base;
	_tmp0_ = self->priv->root;
	if (_tmp0_ != NULL) {
		GeeTreeSetNode* _tmp1_;
		GeeTreeSetNode* _tmp2_;
		_tmp1_ = self->priv->root;
		self->priv->root = NULL;
		gee_tree_set_clear_subtree (self, _tmp1_);
		self->priv->_last = NULL;
		_tmp2_ = self->priv->_last;
		self->priv->_first = _tmp2_;
	}
	self->priv->_size = 0;
	_tmp3_ = self->priv->stamp;
	self->priv->stamp = _tmp3_ + 1;
}


/**
 * {@inheritDoc}
 */
static gboolean gee_tree_set_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) {
	GeeTreeSet * self;
	gboolean result = FALSE;
	self = (GeeTreeSet*) base;
	{
		GeeTreeSetNode* node = NULL;
		GeeTreeSetNode* _tmp0_;
		_tmp0_ = self->priv->_first;
		node = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GeeTreeSetNode* _tmp4_;
				GeeForallFunc _tmp5_;
				void* _tmp5__target;
				GeeTreeSetNode* _tmp6_;
				gconstpointer _tmp7_;
				gpointer _tmp8_;
				gboolean _tmp9_;
				if (!_tmp1_) {
					GeeTreeSetNode* _tmp2_;
					GeeTreeSetNode* _tmp3_;
					_tmp2_ = node;
					_tmp3_ = _tmp2_->next;
					node = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = node;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = f;
				_tmp5__target = f_target;
				_tmp6_ = node;
				_tmp7_ = _tmp6_->key;
				_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;
}


/**
 * {@inheritDoc}
 */
static GeeIterator* gee_tree_set_real_iterator (GeeAbstractCollection* base) {
	GeeTreeSet * self;
	GeeIterator* result = NULL;
	GeeTreeSetIterator* _tmp0_;
	self = (GeeTreeSet*) base;
	_tmp0_ = gee_tree_set_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self);
	result = (GeeIterator*) _tmp0_;
	return result;
}


/**
 * {@inheritDoc}
 */
static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) {
	GeeTreeSet * self;
	GeeBidirIterator* result = NULL;
	GeeTreeSetIterator* _tmp0_;
	self = (GeeTreeSet*) base;
	_tmp0_ = gee_tree_set_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self);
	result = (GeeBidirIterator*) _tmp0_;
	return result;
}


static inline gpointer gee_tree_set_lift_null_get (GeeTreeSet* self, GeeTreeSetNode* node) {
	gpointer result = NULL;
	gconstpointer _tmp0_ = NULL;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = node;
	if (_tmp1_ != NULL) {
		GeeTreeSetNode* _tmp2_;
		gconstpointer _tmp3_;
		_tmp2_ = node;
		_tmp3_ = _tmp2_->key;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = NULL;
	}
	_tmp4_ = ((_tmp0_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	result = _tmp4_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_tree_set_real_first (GeeAbstractSortedSet* base) {
	GeeTreeSet * self;
	gpointer result = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	self = (GeeTreeSet*) base;
	_tmp0_ = self->priv->_first;
	_vala_assert (_tmp0_ != NULL, "_first != null");
	_tmp1_ = self->priv->_first;
	_tmp2_ = _tmp1_->key;
	_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_tree_set_real_last (GeeAbstractSortedSet* base) {
	GeeTreeSet * self;
	gpointer result = NULL;
	GeeTreeSetNode* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	self = (GeeTreeSet*) base;
	_tmp0_ = self->priv->_last;
	_vala_assert (_tmp0_ != NULL, "_last != null");
	_tmp1_ = self->priv->_last;
	_tmp2_ = _tmp1_->key;
	_tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	result = _tmp3_;
	return result;
}


/**
 * {@inheritDoc}
 */
static GeeSortedSet* gee_tree_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) {
	GeeTreeSet * self;
	GeeSortedSet* result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetSubSet* _tmp1_;
	self = (GeeTreeSet*) base;
	_tmp0_ = before;
	_tmp1_ = gee_tree_set_sub_set_new_head (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self, _tmp0_);
	result = (GeeSortedSet*) _tmp1_;
	return result;
}


/**
 * {@inheritDoc}
 */
static GeeSortedSet* gee_tree_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) {
	GeeTreeSet * self;
	GeeSortedSet* result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetSubSet* _tmp1_;
	self = (GeeTreeSet*) base;
	_tmp0_ = after;
	_tmp1_ = gee_tree_set_sub_set_new_tail (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self, _tmp0_);
	result = (GeeSortedSet*) _tmp1_;
	return result;
}


/**
 * {@inheritDoc}
 */
static GeeSortedSet* gee_tree_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) {
	GeeTreeSet * self;
	GeeSortedSet* result = NULL;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	GeeTreeSetSubSet* _tmp2_;
	self = (GeeTreeSet*) base;
	_tmp0_ = after;
	_tmp1_ = before;
	_tmp2_ = gee_tree_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self, _tmp0_, _tmp1_);
	result = (GeeSortedSet*) _tmp2_;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* cur = NULL;
	GeeTreeSetNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->root;
	cur = _tmp0_;
	while (TRUE) {
		GeeTreeSetNode* _tmp1_;
		gint res = 0;
		GCompareDataFunc _tmp2_;
		void* _tmp2__target;
		GCompareDataFunc _tmp3_;
		void* _tmp3__target;
		gconstpointer _tmp4_;
		GeeTreeSetNode* _tmp5_;
		gconstpointer _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp1_ = cur;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target);
		_tmp3_ = _tmp2_;
		_tmp3__target = _tmp2__target;
		_tmp4_ = item;
		_tmp5_ = cur;
		_tmp6_ = _tmp5_->key;
		_tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target);
		res = _tmp7_;
		_tmp8_ = res;
		if (_tmp8_ == 0) {
			GeeTreeSetNode* _tmp9_;
			_tmp9_ = cur;
			result = _tmp9_;
			return result;
		} else {
			gint _tmp10_;
			_tmp10_ = res;
			if (_tmp10_ < 0) {
				GeeTreeSetNode* _tmp11_;
				GeeTreeSetNode* _tmp12_;
				_tmp11_ = cur;
				_tmp12_ = _tmp11_->left;
				cur = _tmp12_;
			} else {
				GeeTreeSetNode* _tmp13_;
				GeeTreeSetNode* _tmp14_;
				_tmp13_ = cur;
				_tmp14_ = _tmp13_->right;
				cur = _tmp14_;
			}
		}
	}
	result = NULL;
	return result;
}


/**
 * {@inheritDoc}
 */
static GeeIterator* gee_tree_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSet * self;
	GeeIterator* result = NULL;
	GeeTreeSetNode* node = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetIterator* _tmp2_ = NULL;
	GeeTreeSetNode* _tmp3_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_node (self, _tmp0_);
	node = _tmp1_;
	_tmp3_ = node;
	if (_tmp3_ != NULL) {
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetIterator* _tmp5_;
		_tmp4_ = node;
		_tmp5_ = gee_tree_set_iterator_new_pointing (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self, _tmp4_);
		_g_object_unref0 (_tmp2_);
		_tmp2_ = _tmp5_;
	} else {
		_g_object_unref0 (_tmp2_);
		_tmp2_ = NULL;
	}
	result = (GeeIterator*) _tmp2_;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_nearest (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* cur = NULL;
	GeeTreeSetNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->root;
	cur = _tmp0_;
	while (TRUE) {
		GeeTreeSetNode* _tmp1_;
		gint res = 0;
		GCompareDataFunc _tmp2_;
		void* _tmp2__target;
		GCompareDataFunc _tmp3_;
		void* _tmp3__target;
		gconstpointer _tmp4_;
		GeeTreeSetNode* _tmp5_;
		gconstpointer _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp1_ = cur;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target);
		_tmp3_ = _tmp2_;
		_tmp3__target = _tmp2__target;
		_tmp4_ = item;
		_tmp5_ = cur;
		_tmp6_ = _tmp5_->key;
		_tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target);
		res = _tmp7_;
		_tmp8_ = res;
		if (_tmp8_ == 0) {
			GeeTreeSetNode* _tmp9_;
			_tmp9_ = cur;
			result = _tmp9_;
			return result;
		} else {
			gint _tmp10_;
			_tmp10_ = res;
			if (_tmp10_ < 0) {
				GeeTreeSetNode* _tmp11_;
				GeeTreeSetNode* _tmp12_;
				GeeTreeSetNode* _tmp14_;
				GeeTreeSetNode* _tmp15_;
				_tmp11_ = cur;
				_tmp12_ = _tmp11_->left;
				if (_tmp12_ == NULL) {
					GeeTreeSetNode* _tmp13_;
					_tmp13_ = cur;
					result = _tmp13_;
					return result;
				}
				_tmp14_ = cur;
				_tmp15_ = _tmp14_->left;
				cur = _tmp15_;
			} else {
				GeeTreeSetNode* _tmp16_;
				GeeTreeSetNode* _tmp17_;
				GeeTreeSetNode* _tmp19_;
				GeeTreeSetNode* _tmp20_;
				_tmp16_ = cur;
				_tmp17_ = _tmp16_->right;
				if (_tmp17_ == NULL) {
					GeeTreeSetNode* _tmp18_;
					_tmp18_ = cur;
					result = _tmp18_;
					return result;
				}
				_tmp19_ = cur;
				_tmp20_ = _tmp19_->right;
				cur = _tmp20_;
			}
		}
	}
	result = NULL;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_lower (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* node = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_ = NULL;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	GCompareDataFunc _tmp5_;
	void* _tmp5__target;
	gconstpointer _tmp6_;
	GeeTreeSetNode* _tmp7_;
	gconstpointer _tmp8_;
	gint _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_nearest (self, _tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target);
	_tmp5_ = _tmp4_;
	_tmp5__target = _tmp4__target;
	_tmp6_ = item;
	_tmp7_ = node;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target);
	if (_tmp9_ <= 0) {
		GeeTreeSetNode* _tmp10_;
		GeeTreeSetNode* _tmp11_;
		_tmp10_ = node;
		_tmp11_ = _tmp10_->prev;
		_tmp3_ = _tmp11_;
	} else {
		GeeTreeSetNode* _tmp12_;
		_tmp12_ = node;
		_tmp3_ = _tmp12_;
	}
	result = _tmp3_;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_higher (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* node = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_ = NULL;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	GCompareDataFunc _tmp5_;
	void* _tmp5__target;
	gconstpointer _tmp6_;
	GeeTreeSetNode* _tmp7_;
	gconstpointer _tmp8_;
	gint _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_nearest (self, _tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target);
	_tmp5_ = _tmp4_;
	_tmp5__target = _tmp4__target;
	_tmp6_ = item;
	_tmp7_ = node;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target);
	if (_tmp9_ >= 0) {
		GeeTreeSetNode* _tmp10_;
		GeeTreeSetNode* _tmp11_;
		_tmp10_ = node;
		_tmp11_ = _tmp10_->next;
		_tmp3_ = _tmp11_;
	} else {
		GeeTreeSetNode* _tmp12_;
		_tmp12_ = node;
		_tmp3_ = _tmp12_;
	}
	result = _tmp3_;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_floor (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* node = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_ = NULL;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	GCompareDataFunc _tmp5_;
	void* _tmp5__target;
	gconstpointer _tmp6_;
	GeeTreeSetNode* _tmp7_;
	gconstpointer _tmp8_;
	gint _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_nearest (self, _tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target);
	_tmp5_ = _tmp4_;
	_tmp5__target = _tmp4__target;
	_tmp6_ = item;
	_tmp7_ = node;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target);
	if (_tmp9_ < 0) {
		GeeTreeSetNode* _tmp10_;
		GeeTreeSetNode* _tmp11_;
		_tmp10_ = node;
		_tmp11_ = _tmp10_->prev;
		_tmp3_ = _tmp11_;
	} else {
		GeeTreeSetNode* _tmp12_;
		_tmp12_ = node;
		_tmp3_ = _tmp12_;
	}
	result = _tmp3_;
	return result;
}


static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpointer item) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetNode* node = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_ = NULL;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	GCompareDataFunc _tmp5_;
	void* _tmp5__target;
	gconstpointer _tmp6_;
	GeeTreeSetNode* _tmp7_;
	gconstpointer _tmp8_;
	gint _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_nearest (self, _tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target);
	_tmp5_ = _tmp4_;
	_tmp5__target = _tmp4__target;
	_tmp6_ = item;
	_tmp7_ = node;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target);
	if (_tmp9_ > 0) {
		GeeTreeSetNode* _tmp10_;
		GeeTreeSetNode* _tmp11_;
		_tmp10_ = node;
		_tmp11_ = _tmp10_->next;
		_tmp3_ = _tmp11_;
	} else {
		GeeTreeSetNode* _tmp12_;
		_tmp12_ = node;
		_tmp3_ = _tmp12_;
	}
	result = _tmp3_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_tree_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSet * self;
	gpointer result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp2_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_lower (self, _tmp0_);
	_tmp2_ = gee_tree_set_lift_null_get (self, _tmp1_);
	result = _tmp2_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_tree_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSet * self;
	gpointer result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp2_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_higher (self, _tmp0_);
	_tmp2_ = gee_tree_set_lift_null_get (self, _tmp1_);
	result = _tmp2_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_tree_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSet * self;
	gpointer result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp2_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_floor (self, _tmp0_);
	_tmp2_ = gee_tree_set_lift_null_get (self, _tmp1_);
	result = _tmp2_;
	return result;
}


/**
 * {@inheritDoc}
 */
static gpointer gee_tree_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSet * self;
	gpointer result = NULL;
	gconstpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gpointer _tmp2_;
	self = (GeeTreeSet*) base;
	_tmp0_ = item;
	_tmp1_ = gee_tree_set_find_ceil (self, _tmp0_);
	_tmp2_ = gee_tree_set_lift_null_get (self, _tmp1_);
	result = _tmp2_;
	return result;
}


static inline gpointer gee_tree_set_min (GeeTreeSet* self, gconstpointer a, gconstpointer b) {
	gpointer result = NULL;
	gconstpointer _tmp0_ = NULL;
	GCompareDataFunc _tmp1_;
	void* _tmp1__target;
	GCompareDataFunc _tmp2_;
	void* _tmp2__target;
	gconstpointer _tmp3_;
	gconstpointer _tmp4_;
	gint _tmp5_;
	gpointer _tmp8_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target);
	_tmp2_ = _tmp1_;
	_tmp2__target = _tmp1__target;
	_tmp3_ = a;
	_tmp4_ = b;
	_tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target);
	if (_tmp5_ <= 0) {
		gconstpointer _tmp6_;
		_tmp6_ = a;
		_tmp0_ = _tmp6_;
	} else {
		gconstpointer _tmp7_;
		_tmp7_ = b;
		_tmp0_ = _tmp7_;
	}
	_tmp8_ = ((_tmp0_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	result = _tmp8_;
	return result;
}


static inline gpointer gee_tree_set_max (GeeTreeSet* self, gconstpointer a, gconstpointer b) {
	gpointer result = NULL;
	gconstpointer _tmp0_ = NULL;
	GCompareDataFunc _tmp1_;
	void* _tmp1__target;
	GCompareDataFunc _tmp2_;
	void* _tmp2__target;
	gconstpointer _tmp3_;
	gconstpointer _tmp4_;
	gint _tmp5_;
	gpointer _tmp8_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target);
	_tmp2_ = _tmp1_;
	_tmp2__target = _tmp1__target;
	_tmp3_ = a;
	_tmp4_ = b;
	_tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target);
	if (_tmp5_ > 0) {
		gconstpointer _tmp6_;
		_tmp6_ = a;
		_tmp0_ = _tmp6_;
	} else {
		gconstpointer _tmp7_;
		_tmp7_ = b;
		_tmp0_ = _tmp7_;
	}
	_tmp8_ = ((_tmp0_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	result = _tmp8_;
	return result;
}


static gint gee_tree_set_real_get_size (GeeAbstractCollection* base) {
	gint result;
	GeeTreeSet* self;
	gint _tmp0_;
	self = (GeeTreeSet*) base;
	_tmp0_ = self->priv->_size;
	result = _tmp0_;
	return result;
}


static gboolean gee_tree_set_real_get_read_only (GeeAbstractCollection* base) {
	gboolean result;
	GeeTreeSet* self;
	self = (GeeTreeSet*) base;
	result = FALSE;
	return result;
}


GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target) {
	GCompareDataFunc result;
	GeeFunctionsCompareDataFuncClosure* _tmp0_;
	GCompareDataFunc _tmp1_;
	void* _tmp1__target;
	GCompareDataFunc _tmp2_;
	void* _tmp2__target;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compare_func;
	_tmp1_ = _tmp0_->func;
	_tmp1__target = _tmp0_->func_target;
	_tmp2_ = _tmp1_;
	_tmp2__target = _tmp1__target;
	*result_target = _tmp2__target;
	result = _tmp2_;
	return result;
}


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


static GeeTreeSetNodeColor gee_tree_set_node_color_flip (GeeTreeSetNodeColor self) {
	GeeTreeSetNodeColor result = 0;
	if (self == GEE_TREE_SET_NODE_COLOR_RED) {
		result = GEE_TREE_SET_NODE_COLOR_BLACK;
		return result;
	} else {
		result = GEE_TREE_SET_NODE_COLOR_RED;
		return result;
	}
}


GType gee_tree_set_node_color_get_type (void) {
	static volatile gsize gee_tree_set_node_color_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_node_color_type_id__volatile)) {
		static const GEnumValue values[] = {{GEE_TREE_SET_NODE_COLOR_RED, "GEE_TREE_SET_NODE_COLOR_RED", "red"}, {GEE_TREE_SET_NODE_COLOR_BLACK, "GEE_TREE_SET_NODE_COLOR_BLACK", "black"}, {0, NULL, NULL}};
		GType gee_tree_set_node_color_type_id;
		gee_tree_set_node_color_type_id = g_enum_register_static ("GeeTreeSetNodeColor", values);
		g_once_init_leave (&gee_tree_set_node_color_type_id__volatile, gee_tree_set_node_color_type_id);
	}
	return gee_tree_set_node_color_type_id__volatile;
}


static GeeTreeSetNode* gee_tree_set_node_new (gpointer node, GeeTreeSetNode* prev, GeeTreeSetNode* next) {
	GeeTreeSetNode* self;
	gpointer _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNode* _tmp5_;
	self = g_slice_new0 (GeeTreeSetNode);
	gee_tree_set_node_instance_init (self);
	_tmp0_ = node;
	node = NULL;
	self->key = _tmp0_;
	self->color = GEE_TREE_SET_NODE_COLOR_RED;
	_tmp1_ = prev;
	self->prev = _tmp1_;
	_tmp2_ = next;
	self->next = _tmp2_;
	_tmp3_ = prev;
	if (_tmp3_ != NULL) {
		GeeTreeSetNode* _tmp4_;
		_tmp4_ = prev;
		_tmp4_->next = self;
	}
	_tmp5_ = next;
	if (_tmp5_ != NULL) {
		GeeTreeSetNode* _tmp6_;
		_tmp6_ = next;
		_tmp6_->prev = self;
	}
	return self;
}


static void gee_tree_set_node_flip (GeeTreeSetNode* self) {
	GeeTreeSetNodeColor _tmp0_;
	GeeTreeSetNodeColor _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSetNode* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->color;
	_tmp1_ = gee_tree_set_node_color_flip (_tmp0_);
	self->color = _tmp1_;
	_tmp2_ = self->left;
	if (_tmp2_ != NULL) {
		GeeTreeSetNode* _tmp3_;
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetNodeColor _tmp5_;
		GeeTreeSetNodeColor _tmp6_;
		_tmp3_ = self->left;
		_tmp4_ = self->left;
		_tmp5_ = _tmp4_->color;
		_tmp6_ = gee_tree_set_node_color_flip (_tmp5_);
		_tmp3_->color = _tmp6_;
	}
	_tmp7_ = self->right;
	if (_tmp7_ != NULL) {
		GeeTreeSetNode* _tmp8_;
		GeeTreeSetNode* _tmp9_;
		GeeTreeSetNodeColor _tmp10_;
		GeeTreeSetNodeColor _tmp11_;
		_tmp8_ = self->right;
		_tmp9_ = self->right;
		_tmp10_ = _tmp9_->color;
		_tmp11_ = gee_tree_set_node_color_flip (_tmp10_);
		_tmp8_->color = _tmp11_;
	}
}


static void gee_tree_set_node_instance_init (GeeTreeSetNode * self) {
}


static void gee_tree_set_node_free (GeeTreeSetNode * self) {
	_gee_tree_set_node_free0 (self->left);
	_gee_tree_set_node_free0 (self->right);
	g_slice_free (GeeTreeSetNode, self);
}


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


static GeeTreeSetIterator* gee_tree_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set) {
	GeeTreeSetIterator * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	gint _tmp3_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetIterator*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->_set);
	self->_set = _tmp1_;
	_tmp2_ = self->_set;
	_tmp3_ = _tmp2_->priv->stamp;
	self->stamp = _tmp3_;
	return self;
}


static GeeTreeSetIterator* gee_tree_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set) {
	return gee_tree_set_iterator_construct (GEE_TREE_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, set);
}


static GeeTreeSetIterator* gee_tree_set_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current) {
	GeeTreeSetIterator * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSet* _tmp3_;
	gint _tmp4_;
	g_return_val_if_fail (set != NULL, NULL);
	g_return_val_if_fail (current != NULL, NULL);
	self = (GeeTreeSetIterator*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->_set);
	self->_set = _tmp1_;
	_tmp2_ = current;
	self->_current = _tmp2_;
	_tmp3_ = set;
	_tmp4_ = _tmp3_->priv->stamp;
	self->stamp = _tmp4_;
	self->started = TRUE;
	return self;
}


static GeeTreeSetIterator* gee_tree_set_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current) {
	return gee_tree_set_iterator_construct_pointing (GEE_TREE_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, set, current);
}


static GeeTreeSetIterator* gee_tree_set_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetIterator* iter) {
	GeeTreeSetIterator * self = NULL;
	GeeTreeSetIterator* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	GeeTreeSetIterator* _tmp3_;
	gint _tmp4_;
	GeeTreeSetIterator* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	GeeTreeSetIterator* _tmp7_;
	GeeTreeSetNode* _tmp8_;
	GeeTreeSetIterator* _tmp9_;
	GeeTreeSetNode* _tmp10_;
	GeeTreeSetIterator* _tmp11_;
	gboolean _tmp12_;
	g_return_val_if_fail (iter != NULL, NULL);
	self = (GeeTreeSetIterator*) 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_->_set;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->_set);
	self->_set = _tmp2_;
	_tmp3_ = iter;
	_tmp4_ = _tmp3_->stamp;
	self->stamp = _tmp4_;
	_tmp5_ = iter;
	_tmp6_ = _tmp5_->_current;
	self->_current = _tmp6_;
	_tmp7_ = iter;
	_tmp8_ = _tmp7_->_next;
	self->_next = _tmp8_;
	_tmp9_ = iter;
	_tmp10_ = _tmp9_->_prev;
	self->_prev = _tmp10_;
	_tmp11_ = iter;
	_tmp12_ = _tmp11_->started;
	self->started = _tmp12_;
	return self;
}


static GeeTreeSetIterator* gee_tree_set_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetIterator* iter) {
	return gee_tree_set_iterator_construct_from_iterator (GEE_TREE_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iter);
}


static gboolean gee_tree_set_iterator_real_next (GeeIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* _tmp3_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	if (_tmp3_ != NULL) {
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetNode* _tmp5_;
		_tmp4_ = self->_current;
		_tmp5_ = _tmp4_->next;
		if (_tmp5_ != NULL) {
			GeeTreeSetNode* _tmp6_;
			GeeTreeSetNode* _tmp7_;
			_tmp6_ = self->_current;
			_tmp7_ = _tmp6_->next;
			self->_current = _tmp7_;
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	} else {
		gboolean _tmp8_;
		_tmp8_ = self->started;
		if (!_tmp8_) {
			GeeTreeSet* _tmp9_;
			GeeTreeSetNode* _tmp10_;
			GeeTreeSetNode* _tmp11_;
			_tmp9_ = self->_set;
			_tmp10_ = _tmp9_->priv->_first;
			self->_current = _tmp10_;
			self->started = TRUE;
			_tmp11_ = self->_current;
			result = _tmp11_ != NULL;
			return result;
		} else {
			GeeTreeSetNode* _tmp12_;
			GeeTreeSetNode* _tmp13_;
			GeeTreeSetNode* _tmp14_;
			_tmp12_ = self->_next;
			self->_current = _tmp12_;
			_tmp13_ = self->_current;
			if (_tmp13_ != NULL) {
				self->_next = NULL;
				self->_prev = NULL;
			}
			_tmp14_ = self->_current;
			result = _tmp14_ != NULL;
			return result;
		}
	}
}


static gboolean gee_tree_set_iterator_real_has_next (GeeIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp6_ = self->started;
	if (!_tmp6_) {
		GeeTreeSet* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		_tmp7_ = self->_set;
		_tmp8_ = _tmp7_->priv->_first;
		_tmp5_ = _tmp8_ != NULL;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		gboolean _tmp9_ = FALSE;
		GeeTreeSetNode* _tmp10_;
		_tmp10_ = self->_current;
		if (_tmp10_ == NULL) {
			GeeTreeSetNode* _tmp11_;
			_tmp11_ = self->_next;
			_tmp9_ = _tmp11_ != NULL;
		} else {
			_tmp9_ = FALSE;
		}
		_tmp4_ = _tmp9_;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp12_ = FALSE;
		GeeTreeSetNode* _tmp13_;
		_tmp13_ = self->_current;
		if (_tmp13_ != NULL) {
			GeeTreeSetNode* _tmp14_;
			GeeTreeSetNode* _tmp15_;
			_tmp14_ = self->_current;
			_tmp15_ = _tmp14_->next;
			_tmp12_ = _tmp15_ != NULL;
		} else {
			_tmp12_ = FALSE;
		}
		_tmp3_ = _tmp12_;
	}
	result = _tmp3_;
	return result;
}


static gboolean gee_tree_set_iterator_real_first (GeeBidirIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSet* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetNode* _tmp5_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_set;
	_tmp4_ = _tmp3_->priv->_first;
	self->_current = _tmp4_;
	self->_next = NULL;
	self->_prev = NULL;
	self->started = TRUE;
	_tmp5_ = self->_current;
	result = _tmp5_ != NULL;
	return result;
}


static gboolean gee_tree_set_iterator_real_previous (GeeBidirIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* _tmp3_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	if (_tmp3_ != NULL) {
		GeeTreeSetNode* _tmp4_;
		GeeTreeSetNode* _tmp5_;
		_tmp4_ = self->_current;
		_tmp5_ = _tmp4_->prev;
		if (_tmp5_ != NULL) {
			GeeTreeSetNode* _tmp6_;
			GeeTreeSetNode* _tmp7_;
			_tmp6_ = self->_current;
			_tmp7_ = _tmp6_->prev;
			self->_current = _tmp7_;
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	} else {
		GeeTreeSetNode* _tmp8_;
		_tmp8_ = self->_prev;
		if (_tmp8_ != NULL) {
			GeeTreeSetNode* _tmp9_;
			_tmp9_ = self->_prev;
			self->_current = _tmp9_;
			self->_next = NULL;
			self->_prev = NULL;
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}


static gboolean gee_tree_set_iterator_real_has_previous (GeeBidirIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	GeeTreeSetNode* _tmp5_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp5_ = self->_current;
	if (_tmp5_ == NULL) {
		GeeTreeSetNode* _tmp6_;
		_tmp6_ = self->_prev;
		_tmp4_ = _tmp6_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp7_ = FALSE;
		GeeTreeSetNode* _tmp8_;
		_tmp8_ = self->_current;
		if (_tmp8_ != NULL) {
			GeeTreeSetNode* _tmp9_;
			GeeTreeSetNode* _tmp10_;
			_tmp9_ = self->_current;
			_tmp10_ = _tmp9_->prev;
			_tmp7_ = _tmp10_ != NULL;
		} else {
			_tmp7_ = FALSE;
		}
		_tmp3_ = _tmp7_;
	}
	result = _tmp3_;
	return result;
}


static gboolean gee_tree_set_iterator_real_last (GeeBidirIterator* base) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSet* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetNode* _tmp5_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_set;
	_tmp4_ = _tmp3_->priv->_last;
	self->_current = _tmp4_;
	self->_next = NULL;
	self->_prev = NULL;
	self->started = TRUE;
	_tmp5_ = self->_current;
	result = _tmp5_ != NULL;
	return result;
}


static gpointer gee_tree_set_iterator_real_get (GeeIterator* base) {
	GeeTreeSetIterator * self;
	gpointer result = NULL;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	gconstpointer _tmp5_;
	gpointer _tmp6_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	_vala_assert (_tmp3_ != NULL, "_current != null");
	_tmp4_ = self->_current;
	_tmp5_ = _tmp4_->key;
	_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_tree_set_iterator_real_remove (GeeIterator* base) {
	GeeTreeSetIterator * self;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* _tmp3_;
	gboolean success = FALSE;
	GeeTreeSet* _tmp4_;
	GeeTreeSet* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	gconstpointer _tmp7_;
	GeeTreeSetNode* _tmp8_ = NULL;
	GeeTreeSetNode* _tmp9_ = NULL;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GeeTreeSet* _tmp12_;
	GeeTreeSetNode* _tmp13_;
	gint _tmp16_;
	GeeTreeSet* _tmp17_;
	gint _tmp18_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	_vala_assert (_tmp3_ != NULL, "_current != null");
	_tmp4_ = self->_set;
	_tmp5_ = self->_set;
	_tmp6_ = self->_current;
	_tmp7_ = _tmp6_->key;
	_tmp10_ = gee_tree_set_remove_from_node (_tmp4_, &_tmp5_->priv->root, _tmp7_, &_tmp8_, &_tmp9_);
	self->_prev = _tmp8_;
	self->_next = _tmp9_;
	success = _tmp10_;
	_tmp11_ = success;
	_vala_assert (_tmp11_, "success");
	_tmp12_ = self->_set;
	_tmp13_ = _tmp12_->priv->root;
	if (_tmp13_ != NULL) {
		GeeTreeSet* _tmp14_;
		GeeTreeSetNode* _tmp15_;
		_tmp14_ = self->_set;
		_tmp15_ = _tmp14_->priv->root;
		_tmp15_->color = GEE_TREE_SET_NODE_COLOR_BLACK;
	}
	self->_current = NULL;
	_tmp16_ = self->stamp;
	self->stamp = _tmp16_ + 1;
	_tmp17_ = self->_set;
	_tmp18_ = _tmp17_->priv->stamp;
	_tmp17_->priv->stamp = _tmp18_ + 1;
	_vala_assert (_tmp16_ == _tmp18_, "stamp++ == _set.stamp++");
}


static gboolean gee_tree_set_iterator_safe_next_get (GeeTreeSetIterator* self, gpointer* val) {
	gpointer _vala_val = NULL;
	gboolean result = FALSE;
	GeeTreeSetNode* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_current;
	if (_tmp0_ != NULL) {
		GeeTreeSet* _tmp1_;
		GeeTreeSetNode* _tmp2_;
		GeeTreeSetNode* _tmp3_;
		gpointer _tmp4_;
		GeeTreeSetNode* _tmp5_;
		GeeTreeSetNode* _tmp6_;
		_tmp1_ = self->_set;
		_tmp2_ = self->_current;
		_tmp3_ = _tmp2_->next;
		_tmp4_ = gee_tree_set_lift_null_get (_tmp1_, _tmp3_);
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		_vala_val = _tmp4_;
		_tmp5_ = self->_current;
		_tmp6_ = _tmp5_->next;
		result = _tmp6_ != NULL;
		if (val) {
			*val = _vala_val;
		} else {
			((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		}
		return result;
	} else {
		GeeTreeSet* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		gpointer _tmp9_;
		GeeTreeSetNode* _tmp10_;
		_tmp7_ = self->_set;
		_tmp8_ = self->_next;
		_tmp9_ = gee_tree_set_lift_null_get (_tmp7_, _tmp8_);
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		_vala_val = _tmp9_;
		_tmp10_ = self->_next;
		result = _tmp10_ != NULL;
		if (val) {
			*val = _vala_val;
		} else {
			((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		}
		return result;
	}
	if (val) {
		*val = _vala_val;
	} else {
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
	}
}


static gboolean gee_tree_set_iterator_safe_previous_get (GeeTreeSetIterator* self, gpointer* val) {
	gpointer _vala_val = NULL;
	gboolean result = FALSE;
	GeeTreeSetNode* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_current;
	if (_tmp0_ != NULL) {
		GeeTreeSet* _tmp1_;
		GeeTreeSetNode* _tmp2_;
		GeeTreeSetNode* _tmp3_;
		gpointer _tmp4_;
		GeeTreeSetNode* _tmp5_;
		GeeTreeSetNode* _tmp6_;
		_tmp1_ = self->_set;
		_tmp2_ = self->_current;
		_tmp3_ = _tmp2_->prev;
		_tmp4_ = gee_tree_set_lift_null_get (_tmp1_, _tmp3_);
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		_vala_val = _tmp4_;
		_tmp5_ = self->_current;
		_tmp6_ = _tmp5_->prev;
		result = _tmp6_ != NULL;
		if (val) {
			*val = _vala_val;
		} else {
			((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		}
		return result;
	} else {
		GeeTreeSet* _tmp7_;
		GeeTreeSetNode* _tmp8_;
		gpointer _tmp9_;
		GeeTreeSetNode* _tmp10_;
		_tmp7_ = self->_set;
		_tmp8_ = self->_prev;
		_tmp9_ = gee_tree_set_lift_null_get (_tmp7_, _tmp8_);
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		_vala_val = _tmp9_;
		_tmp10_ = self->_next;
		result = _tmp10_ != NULL;
		if (val) {
			*val = _vala_val;
		} else {
			((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
		}
		return result;
	}
	if (val) {
		*val = _vala_val;
	} else {
		((_vala_val == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_val = (self->priv->g_destroy_func (_vala_val), NULL));
	}
}


static gboolean gee_tree_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
	GeeTreeSetIterator * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* current = NULL;
	GeeTreeSetNode* _tmp3_;
	GeeTreeSetNode* next = NULL;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetNode* _tmp28_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	current = _tmp3_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		GeeForallFunc _tmp5_;
		void* _tmp5__target;
		GeeTreeSetNode* _tmp6_;
		gconstpointer _tmp7_;
		gpointer _tmp8_;
		gboolean _tmp9_;
		GeeTreeSetNode* _tmp10_;
		GeeTreeSetNode* _tmp11_;
		_tmp5_ = f;
		_tmp5__target = f_target;
		_tmp6_ = current;
		_tmp7_ = _tmp6_->key;
		_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;
		}
		_tmp10_ = current;
		_tmp11_ = _tmp10_->next;
		next = _tmp11_;
	} else {
		gboolean _tmp12_;
		_tmp12_ = self->started;
		if (!_tmp12_) {
			GeeTreeSet* _tmp13_;
			GeeTreeSetNode* _tmp14_;
			GeeTreeSetNode* _tmp15_;
			_tmp13_ = self->_set;
			_tmp14_ = _tmp13_->priv->_first;
			next = _tmp14_;
			_tmp15_ = next;
			if (_tmp15_ != NULL) {
				self->started = TRUE;
			}
		} else {
			GeeTreeSetNode* _tmp16_;
			GeeTreeSetNode* _tmp17_;
			_tmp16_ = self->_next;
			next = _tmp16_;
			_tmp17_ = next;
			if (_tmp17_ != NULL) {
				self->_next = NULL;
				self->_prev = NULL;
			}
		}
	}
	while (TRUE) {
		GeeTreeSetNode* _tmp18_;
		GeeForallFunc _tmp19_;
		void* _tmp19__target;
		GeeTreeSetNode* _tmp20_;
		gconstpointer _tmp21_;
		gpointer _tmp22_;
		gboolean _tmp23_;
		GeeTreeSetNode* _tmp25_;
		GeeTreeSetNode* _tmp26_;
		GeeTreeSetNode* _tmp27_;
		_tmp18_ = next;
		if (!(_tmp18_ != NULL)) {
			break;
		}
		_tmp19_ = f;
		_tmp19__target = f_target;
		_tmp20_ = next;
		_tmp21_ = _tmp20_->key;
		_tmp22_ = ((_tmp21_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp21_) : ((gpointer) _tmp21_);
		_tmp23_ = _tmp19_ (_tmp22_, _tmp19__target);
		if (!_tmp23_) {
			GeeTreeSetNode* _tmp24_;
			_tmp24_ = next;
			self->_current = _tmp24_;
			result = FALSE;
			return result;
		}
		_tmp25_ = next;
		current = _tmp25_;
		_tmp26_ = current;
		_tmp27_ = _tmp26_->next;
		next = _tmp27_;
	}
	_tmp28_ = current;
	self->_current = _tmp28_;
	result = TRUE;
	return result;
}


static GeeIterator** gee_tree_set_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1) {
	GeeTreeSetIterator * self;
	GeeIterator** result = NULL;
	guint _tmp0_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = forks;
	if (_tmp0_ == ((guint) 0)) {
		GeeIterator** _tmp1_;
		GeeIterator** _tmp2_;
		gint _tmp2__length1;
		_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_;
		GeeIterator** _tmp4_;
		gint _result__length1;
		gint __result__size_;
		GeeIterator** _tmp5_;
		gint _tmp5__length1;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator** _tmp16_;
		gint _tmp16__length1;
		_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_;
					guint _tmp11_;
					GeeIterator** _tmp12_;
					gint _tmp12__length1;
					guint _tmp13_;
					GeeTreeSetIterator* _tmp14_;
					GeeIterator* _tmp15_;
					if (!_tmp8_) {
						guint _tmp9_;
						_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_tree_set_iterator_new_from_iterator (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) 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_tree_set_iterator_real_get_valid (GeeIterator* base) {
	gboolean result;
	GeeTreeSetIterator* self;
	gint _tmp0_;
	GeeTreeSet* _tmp1_;
	gint _tmp2_;
	GeeTreeSetNode* _tmp3_;
	self = (GeeTreeSetIterator*) base;
	_tmp0_ = self->stamp;
	_tmp1_ = self->_set;
	_tmp2_ = _tmp1_->priv->stamp;
	_vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp");
	_tmp3_ = self->_current;
	result = _tmp3_ != NULL;
	return result;
}


static gboolean gee_tree_set_iterator_real_get_read_only (GeeIterator* base) {
	gboolean result;
	GeeTreeSetIterator* self;
	self = (GeeTreeSetIterator*) base;
	result = FALSE;
	return result;
}


static void gee_tree_set_iterator_class_init (GeeTreeSetIteratorClass * klass) {
	gee_tree_set_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeTreeSetIteratorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_tree_set_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_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_TREE_SET_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_TREE_SET_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_TREE_SET_ITERATOR_VALID_PROPERTY, g_param_spec_boolean ("valid", "valid", "valid", 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_TREE_SET_ITERATOR_READ_ONLY_PROPERTY, 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));
}


static GType gee_tree_set_iterator_gee_traversable_get_g_type (GeeTreeSetIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_tree_set_iterator_gee_traversable_get_g_dup_func (GeeTreeSetIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_tree_set_iterator_gee_traversable_get_g_destroy_func (GeeTreeSetIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_tree_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
	gee_tree_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*) (GeeTraversable *, GeeForallFunc, void*)) gee_tree_set_iterator_real_foreach;
	iface->tee = (GeeIterator** (*) (GeeTraversable *, guint, int*)) gee_tree_set_iterator_real_tee;
	iface->get_g_type = (GType (*) (GeeTraversable *)) gee_tree_set_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeTraversable *)) gee_tree_set_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeTraversable *)) gee_tree_set_iterator_gee_traversable_get_g_destroy_func;
}


static void gee_tree_set_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
	gee_tree_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*) (GeeIterator *)) gee_tree_set_iterator_real_next;
	iface->has_next = (gboolean (*) (GeeIterator *)) gee_tree_set_iterator_real_has_next;
	iface->get = (gpointer (*) (GeeIterator *)) gee_tree_set_iterator_real_get;
	iface->remove = (void (*) (GeeIterator *)) gee_tree_set_iterator_real_remove;
	iface->get_valid = gee_tree_set_iterator_real_get_valid;
	iface->get_read_only = gee_tree_set_iterator_real_get_read_only;
}


static GType gee_tree_set_iterator_gee_bidir_iterator_get_g_type (GeeTreeSetIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_tree_set_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeSetIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_tree_set_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeSetIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_tree_set_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) {
	gee_tree_set_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->first = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_iterator_real_first;
	iface->previous = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_iterator_real_previous;
	iface->has_previous = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_iterator_real_has_previous;
	iface->last = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_iterator_real_last;
	iface->get_g_type = (GType (*) (GeeBidirIterator *)) gee_tree_set_iterator_gee_bidir_iterator_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeBidirIterator *)) gee_tree_set_iterator_gee_bidir_iterator_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeBidirIterator *)) gee_tree_set_iterator_gee_bidir_iterator_get_g_destroy_func;
}


static void gee_tree_set_iterator_instance_init (GeeTreeSetIterator * self) {
	self->priv = GEE_TREE_SET_ITERATOR_GET_PRIVATE (self);
	self->_current = NULL;
	self->_next = NULL;
	self->_prev = NULL;
	self->started = FALSE;
}


static void gee_tree_set_iterator_finalize (GObject * obj) {
	GeeTreeSetIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIterator);
	_g_object_unref0 (self->_set);
	G_OBJECT_CLASS (gee_tree_set_iterator_parent_class)->finalize (obj);
}


static GType gee_tree_set_iterator_get_type (void) {
	static volatile gsize gee_tree_set_iterator_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_iterator_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetIterator), 0, (GInstanceInitFunc) gee_tree_set_iterator_instance_init, NULL };
		static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_tree_set_iterator_type_id;
		gee_tree_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeSetIterator", &g_define_type_info, 0);
		g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
		g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
		g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info);
		g_once_init_leave (&gee_tree_set_iterator_type_id__volatile, gee_tree_set_iterator_type_id);
	}
	return gee_tree_set_iterator_type_id__volatile;
}


static void _vala_gee_tree_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeTreeSetIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIterator);
	switch (property_id) {
		case GEE_TREE_SET_ITERATOR_VALID_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		case GEE_TREE_SET_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_tree_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeTreeSetIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIterator);
	switch (property_id) {
		case GEE_TREE_SET_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_TREE_SET_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_TREE_SET_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 GeeTreeSetRange* gee_tree_set_range_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before) {
	GeeTreeSetRange* self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	GCompareDataFunc _tmp3_;
	void* _tmp3__target;
	GCompareDataFunc _tmp4_;
	void* _tmp4__target;
	gconstpointer _tmp5_;
	gconstpointer _tmp6_;
	gint _tmp7_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetRange*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->set);
	self->priv->set = _tmp1_;
	_tmp2_ = set;
	_tmp3_ = gee_tree_set_get_compare_func (_tmp2_, &_tmp3__target);
	_tmp4_ = _tmp3_;
	_tmp4__target = _tmp3__target;
	_tmp5_ = after;
	_tmp6_ = before;
	_tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target);
	if (_tmp7_ < 0) {
		gconstpointer _tmp8_;
		gpointer _tmp9_;
		gconstpointer _tmp10_;
		gpointer _tmp11_;
		_tmp8_ = after;
		_tmp9_ = ((_tmp8_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
		_g_destroy_func0 (self->priv->after);
		self->priv->after = _tmp9_;
		_tmp10_ = before;
		_tmp11_ = ((_tmp10_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_);
		_g_destroy_func0 (self->priv->before);
		self->priv->before = _tmp11_;
		self->priv->type = GEE_TREE_SET_RANGE_TYPE_BOUNDED;
	} else {
		self->priv->type = GEE_TREE_SET_RANGE_TYPE_EMPTY;
	}
	return self;
}


static GeeTreeSetRange* gee_tree_set_range_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before) {
	return gee_tree_set_range_construct (GEE_TREE_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, set, after, before);
}


static GeeTreeSetRange* gee_tree_set_range_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before) {
	GeeTreeSetRange* self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetRange*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->set);
	self->priv->set = _tmp1_;
	_tmp2_ = before;
	_tmp3_ = ((_tmp2_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	_g_destroy_func0 (self->priv->before);
	self->priv->before = _tmp3_;
	self->priv->type = GEE_TREE_SET_RANGE_TYPE_HEAD;
	return self;
}


static GeeTreeSetRange* gee_tree_set_range_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before) {
	return gee_tree_set_range_construct_head (GEE_TREE_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, set, before);
}


static GeeTreeSetRange* gee_tree_set_range_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after) {
	GeeTreeSetRange* self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetRange*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->set);
	self->priv->set = _tmp1_;
	_tmp2_ = after;
	_tmp3_ = ((_tmp2_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	_g_destroy_func0 (self->priv->after);
	self->priv->after = _tmp3_;
	self->priv->type = GEE_TREE_SET_RANGE_TYPE_TAIL;
	return self;
}


static GeeTreeSetRange* gee_tree_set_range_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after) {
	return gee_tree_set_range_construct_tail (GEE_TREE_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, set, after);
}


static gpointer _gee_tree_set_range_ref0 (gpointer self) {
	return self ? gee_tree_set_range_ref (self) : NULL;
}


static GeeTreeSetRange* gee_tree_set_range_cut_head (GeeTreeSetRange* self, gconstpointer after) {
	GeeTreeSetRange* result = NULL;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_HEAD:
		{
			GeeTreeSet* _tmp1_;
			gconstpointer _tmp2_;
			gconstpointer _tmp3_;
			GeeTreeSetRange* _tmp4_;
			_tmp1_ = self->priv->set;
			_tmp2_ = after;
			_tmp3_ = self->priv->before;
			_tmp4_ = gee_tree_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp1_, _tmp2_, _tmp3_);
			result = _tmp4_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_TAIL:
		{
			GeeTreeSet* _tmp5_;
			GeeTreeSet* _tmp6_;
			gconstpointer _tmp7_;
			gconstpointer _tmp8_;
			gpointer _tmp9_;
			gpointer _tmp10_;
			GeeTreeSetRange* _tmp11_;
			GeeTreeSetRange* _tmp12_;
			_tmp5_ = self->priv->set;
			_tmp6_ = self->priv->set;
			_tmp7_ = after;
			_tmp8_ = self->priv->after;
			_tmp9_ = gee_tree_set_max (_tmp6_, _tmp7_, _tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = gee_tree_set_range_new_tail (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp5_, _tmp10_);
			_tmp12_ = _tmp11_;
			((_tmp10_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp10_ = (self->priv->g_destroy_func (_tmp10_), NULL));
			result = _tmp12_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			GeeTreeSetRange* _tmp13_;
			_tmp13_ = _gee_tree_set_range_ref0 (self);
			result = _tmp13_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_BOUNDED:
		{
			gpointer _after = NULL;
			GeeTreeSet* _tmp14_;
			gconstpointer _tmp15_;
			gconstpointer _tmp16_;
			gpointer _tmp17_;
			GeeTreeSet* _tmp18_;
			gconstpointer _tmp19_;
			gconstpointer _tmp20_;
			GeeTreeSetRange* _tmp21_;
			_tmp14_ = self->priv->set;
			_tmp15_ = after;
			_tmp16_ = self->priv->after;
			_tmp17_ = gee_tree_set_max (_tmp14_, _tmp15_, _tmp16_);
			_after = _tmp17_;
			_tmp18_ = self->priv->set;
			_tmp19_ = _after;
			_tmp20_ = self->priv->before;
			_tmp21_ = gee_tree_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp18_, _tmp19_, _tmp20_);
			result = _tmp21_;
			((_after == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_after = (self->priv->g_destroy_func (_after), NULL));
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


static GeeTreeSetRange* gee_tree_set_range_cut_tail (GeeTreeSetRange* self, gconstpointer before) {
	GeeTreeSetRange* result = NULL;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_HEAD:
		{
			GeeTreeSet* _tmp1_;
			GeeTreeSet* _tmp2_;
			gconstpointer _tmp3_;
			gconstpointer _tmp4_;
			gpointer _tmp5_;
			gpointer _tmp6_;
			GeeTreeSetRange* _tmp7_;
			GeeTreeSetRange* _tmp8_;
			_tmp1_ = self->priv->set;
			_tmp2_ = self->priv->set;
			_tmp3_ = before;
			_tmp4_ = self->priv->before;
			_tmp5_ = gee_tree_set_min (_tmp2_, _tmp3_, _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = gee_tree_set_range_new_head (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp1_, _tmp6_);
			_tmp8_ = _tmp7_;
			((_tmp6_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp6_ = (self->priv->g_destroy_func (_tmp6_), NULL));
			result = _tmp8_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_TAIL:
		{
			GeeTreeSet* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeTreeSetRange* _tmp12_;
			_tmp9_ = self->priv->set;
			_tmp10_ = self->priv->after;
			_tmp11_ = before;
			_tmp12_ = gee_tree_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp9_, _tmp10_, _tmp11_);
			result = _tmp12_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			GeeTreeSetRange* _tmp13_;
			_tmp13_ = _gee_tree_set_range_ref0 (self);
			result = _tmp13_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_BOUNDED:
		{
			gpointer _before = NULL;
			GeeTreeSet* _tmp14_;
			gconstpointer _tmp15_;
			gconstpointer _tmp16_;
			gpointer _tmp17_;
			GeeTreeSet* _tmp18_;
			gconstpointer _tmp19_;
			gconstpointer _tmp20_;
			GeeTreeSetRange* _tmp21_;
			_tmp14_ = self->priv->set;
			_tmp15_ = before;
			_tmp16_ = self->priv->before;
			_tmp17_ = gee_tree_set_min (_tmp14_, _tmp15_, _tmp16_);
			_before = _tmp17_;
			_tmp18_ = self->priv->set;
			_tmp19_ = self->priv->after;
			_tmp20_ = _before;
			_tmp21_ = gee_tree_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp18_, _tmp19_, _tmp20_);
			result = _tmp21_;
			((_before == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_before = (self->priv->g_destroy_func (_before), NULL));
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


static GeeTreeSetRange* gee_tree_set_range_cut (GeeTreeSetRange* self, gconstpointer after, gconstpointer before) {
	GeeTreeSetRange* result = NULL;
	GeeTreeSetRangeType _tmp0_;
	gpointer _tmp2_ = NULL;
	GeeTreeSetRangeType _tmp3_;
	gpointer _before = NULL;
	gpointer _tmp10_;
	gpointer _tmp11_ = NULL;
	GeeTreeSetRangeType _tmp12_;
	gpointer _after = NULL;
	gpointer _tmp19_;
	GeeTreeSet* _tmp20_;
	gconstpointer _tmp21_;
	gconstpointer _tmp22_;
	GeeTreeSetRange* _tmp23_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type;
	if (_tmp0_ == GEE_TREE_SET_RANGE_TYPE_EMPTY) {
		GeeTreeSetRange* _tmp1_;
		_tmp1_ = _gee_tree_set_range_ref0 (self);
		result = _tmp1_;
		return result;
	}
	_tmp3_ = self->priv->type;
	if (_tmp3_ != GEE_TREE_SET_RANGE_TYPE_TAIL) {
		GeeTreeSet* _tmp4_;
		gconstpointer _tmp5_;
		gconstpointer _tmp6_;
		gpointer _tmp7_;
		_tmp4_ = self->priv->set;
		_tmp5_ = before;
		_tmp6_ = self->priv->before;
		_tmp7_ = gee_tree_set_min (_tmp4_, _tmp5_, _tmp6_);
		((_tmp2_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->g_destroy_func (_tmp2_), NULL));
		_tmp2_ = _tmp7_;
	} else {
		gconstpointer _tmp8_;
		gpointer _tmp9_;
		_tmp8_ = before;
		_tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
		((_tmp2_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->g_destroy_func (_tmp2_), NULL));
		_tmp2_ = _tmp9_;
	}
	_tmp10_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	_before = _tmp10_;
	_tmp12_ = self->priv->type;
	if (_tmp12_ != GEE_TREE_SET_RANGE_TYPE_HEAD) {
		GeeTreeSet* _tmp13_;
		gconstpointer _tmp14_;
		gconstpointer _tmp15_;
		gpointer _tmp16_;
		_tmp13_ = self->priv->set;
		_tmp14_ = after;
		_tmp15_ = self->priv->after;
		_tmp16_ = gee_tree_set_max (_tmp13_, _tmp14_, _tmp15_);
		((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL));
		_tmp11_ = _tmp16_;
	} else {
		gconstpointer _tmp17_;
		gpointer _tmp18_;
		_tmp17_ = after;
		_tmp18_ = ((_tmp17_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp17_) : ((gpointer) _tmp17_);
		((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL));
		_tmp11_ = _tmp18_;
	}
	_tmp19_ = ((_tmp11_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_);
	_after = _tmp19_;
	_tmp20_ = self->priv->set;
	_tmp21_ = _after;
	_tmp22_ = _before;
	_tmp23_ = gee_tree_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp20_, _tmp21_, _tmp22_);
	result = _tmp23_;
	((_after == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_after = (self->priv->g_destroy_func (_after), NULL));
	((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL));
	((_before == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_before = (self->priv->g_destroy_func (_before), NULL));
	((_tmp2_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->g_destroy_func (_tmp2_), NULL));
	return result;
}


static gboolean gee_tree_set_range_in_range (GeeTreeSetRange* self, gconstpointer item) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetRangeType _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->type;
	if (_tmp1_ == GEE_TREE_SET_RANGE_TYPE_EMPTY) {
		_tmp0_ = FALSE;
	} else {
		gconstpointer _tmp2_;
		gint _tmp3_;
		_tmp2_ = item;
		_tmp3_ = gee_tree_set_range_compare_range (self, _tmp2_);
		_tmp0_ = _tmp3_ == 0;
	}
	result = _tmp0_;
	return result;
}


static gint gee_tree_set_range_compare_range (GeeTreeSetRange* self, gconstpointer item) {
	gint result = 0;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_HEAD:
		{
			gint _tmp1_ = 0;
			GeeTreeSet* _tmp2_;
			GCompareDataFunc _tmp3_;
			void* _tmp3__target;
			GCompareDataFunc _tmp4_;
			void* _tmp4__target;
			gconstpointer _tmp5_;
			gconstpointer _tmp6_;
			gint _tmp7_;
			_tmp2_ = self->priv->set;
			_tmp3_ = gee_tree_set_get_compare_func (_tmp2_, &_tmp3__target);
			_tmp4_ = _tmp3_;
			_tmp4__target = _tmp3__target;
			_tmp5_ = item;
			_tmp6_ = self->priv->before;
			_tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target);
			if (_tmp7_ < 0) {
				_tmp1_ = 0;
			} else {
				_tmp1_ = 1;
			}
			result = _tmp1_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_TAIL:
		{
			gint _tmp8_ = 0;
			GeeTreeSet* _tmp9_;
			GCompareDataFunc _tmp10_;
			void* _tmp10__target;
			GCompareDataFunc _tmp11_;
			void* _tmp11__target;
			gconstpointer _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			_tmp9_ = self->priv->set;
			_tmp10_ = gee_tree_set_get_compare_func (_tmp9_, &_tmp10__target);
			_tmp11_ = _tmp10_;
			_tmp11__target = _tmp10__target;
			_tmp12_ = item;
			_tmp13_ = self->priv->after;
			_tmp14_ = _tmp11_ (_tmp12_, _tmp13_, _tmp11__target);
			if (_tmp14_ >= 0) {
				_tmp8_ = 0;
			} else {
				_tmp8_ = -1;
			}
			result = _tmp8_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			result = 0;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_BOUNDED:
		{
			gint _tmp15_ = 0;
			GeeTreeSet* _tmp16_;
			GCompareDataFunc _tmp17_;
			void* _tmp17__target;
			GCompareDataFunc _tmp18_;
			void* _tmp18__target;
			gconstpointer _tmp19_;
			gconstpointer _tmp20_;
			gint _tmp21_;
			_tmp16_ = self->priv->set;
			_tmp17_ = gee_tree_set_get_compare_func (_tmp16_, &_tmp17__target);
			_tmp18_ = _tmp17_;
			_tmp18__target = _tmp17__target;
			_tmp19_ = item;
			_tmp20_ = self->priv->after;
			_tmp21_ = _tmp18_ (_tmp19_, _tmp20_, _tmp18__target);
			if (_tmp21_ >= 0) {
				gint _tmp22_ = 0;
				GeeTreeSet* _tmp23_;
				GCompareDataFunc _tmp24_;
				void* _tmp24__target;
				GCompareDataFunc _tmp25_;
				void* _tmp25__target;
				gconstpointer _tmp26_;
				gconstpointer _tmp27_;
				gint _tmp28_;
				_tmp23_ = self->priv->set;
				_tmp24_ = gee_tree_set_get_compare_func (_tmp23_, &_tmp24__target);
				_tmp25_ = _tmp24_;
				_tmp25__target = _tmp24__target;
				_tmp26_ = item;
				_tmp27_ = self->priv->before;
				_tmp28_ = _tmp25_ (_tmp26_, _tmp27_, _tmp25__target);
				if (_tmp28_ < 0) {
					_tmp22_ = 0;
				} else {
					_tmp22_ = 1;
				}
				_tmp15_ = _tmp22_;
			} else {
				_tmp15_ = -1;
			}
			result = _tmp15_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


static gboolean gee_tree_set_range_empty_subset (GeeTreeSetRange* self) {
	gboolean result = FALSE;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_HEAD:
		{
			gboolean _tmp1_ = FALSE;
			GeeTreeSet* _tmp2_;
			GeeTreeSetNode* _tmp3_;
			_tmp2_ = self->priv->set;
			_tmp3_ = _tmp2_->priv->_first;
			if (_tmp3_ == NULL) {
				_tmp1_ = TRUE;
			} else {
				GeeTreeSet* _tmp4_;
				GeeTreeSetNode* _tmp5_;
				gconstpointer _tmp6_;
				gboolean _tmp7_;
				_tmp4_ = self->priv->set;
				_tmp5_ = _tmp4_->priv->_first;
				_tmp6_ = _tmp5_->key;
				_tmp7_ = gee_tree_set_range_in_range (self, _tmp6_);
				_tmp1_ = !_tmp7_;
			}
			result = _tmp1_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_TAIL:
		{
			gboolean _tmp8_ = FALSE;
			GeeTreeSet* _tmp9_;
			GeeTreeSetNode* _tmp10_;
			_tmp9_ = self->priv->set;
			_tmp10_ = _tmp9_->priv->_last;
			if (_tmp10_ == NULL) {
				_tmp8_ = TRUE;
			} else {
				GeeTreeSet* _tmp11_;
				GeeTreeSetNode* _tmp12_;
				gconstpointer _tmp13_;
				gboolean _tmp14_;
				_tmp11_ = self->priv->set;
				_tmp12_ = _tmp11_->priv->_last;
				_tmp13_ = _tmp12_->key;
				_tmp14_ = gee_tree_set_range_in_range (self, _tmp13_);
				_tmp8_ = !_tmp14_;
			}
			result = _tmp8_;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			result = TRUE;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_BOUNDED:
		{
			GeeTreeSetNode* _tmp15_;
			_tmp15_ = gee_tree_set_range_first (self);
			result = _tmp15_ == NULL;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


static GeeTreeSetNode* gee_tree_set_range_first (GeeTreeSetRange* self) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			result = NULL;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_HEAD:
		{
			GeeTreeSet* _tmp1_;
			GeeTreeSetNode* _tmp2_;
			_tmp1_ = self->priv->set;
			_tmp2_ = _tmp1_->priv->_first;
			result = _tmp2_;
			return result;
		}
		default:
		{
			GeeTreeSet* _tmp3_;
			gconstpointer _tmp4_;
			GeeTreeSetNode* _tmp5_;
			_tmp3_ = self->priv->set;
			_tmp4_ = self->priv->after;
			_tmp5_ = gee_tree_set_find_floor (_tmp3_, _tmp4_);
			result = _tmp5_;
			return result;
		}
	}
}


static GeeTreeSetNode* gee_tree_set_range_last (GeeTreeSetRange* self) {
	GeeTreeSetNode* result = NULL;
	GeeTreeSetRangeType _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type;
	switch (_tmp0_) {
		case GEE_TREE_SET_RANGE_TYPE_EMPTY:
		{
			result = NULL;
			return result;
		}
		case GEE_TREE_SET_RANGE_TYPE_TAIL:
		{
			GeeTreeSet* _tmp1_;
			GeeTreeSetNode* _tmp2_;
			_tmp1_ = self->priv->set;
			_tmp2_ = _tmp1_->priv->_last;
			result = _tmp2_;
			return result;
		}
		default:
		{
			GeeTreeSet* _tmp3_;
			gconstpointer _tmp4_;
			GeeTreeSetNode* _tmp5_;
			_tmp3_ = self->priv->set;
			_tmp4_ = self->priv->before;
			_tmp5_ = gee_tree_set_find_lower (_tmp3_, _tmp4_);
			result = _tmp5_;
			return result;
		}
	}
}


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


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


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


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


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


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


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


static void gee_tree_set_value_set_range (GValue* value, gpointer v_object) {
	GeeTreeSetRange * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TREE_SET_TYPE_RANGE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TREE_SET_TYPE_RANGE));
		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_tree_set_range_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_tree_set_range_unref (old);
	}
}


static void gee_tree_set_value_take_range (GValue* value, gpointer v_object) {
	GeeTreeSetRange * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TREE_SET_TYPE_RANGE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TREE_SET_TYPE_RANGE));
		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_tree_set_range_unref (old);
	}
}


static void gee_tree_set_range_class_init (GeeTreeSetRangeClass * klass) {
	gee_tree_set_range_parent_class = g_type_class_peek_parent (klass);
	((GeeTreeSetRangeClass *) klass)->finalize = gee_tree_set_range_finalize;
	g_type_class_add_private (klass, sizeof (GeeTreeSetRangePrivate));
}


static void gee_tree_set_range_instance_init (GeeTreeSetRange * self) {
	self->priv = GEE_TREE_SET_RANGE_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void gee_tree_set_range_finalize (GeeTreeSetRange * obj) {
	GeeTreeSetRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_SET_TYPE_RANGE, GeeTreeSetRange);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->set);
	((self->priv->after == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->after = (self->priv->g_destroy_func (self->priv->after), NULL));
	((self->priv->before == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->before = (self->priv->g_destroy_func (self->priv->before), NULL));
}


static GType gee_tree_set_range_get_type (void) {
	static volatile gsize gee_tree_set_range_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_range_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gee_tree_set_value_range_init, gee_tree_set_value_range_free_value, gee_tree_set_value_range_copy_value, gee_tree_set_value_range_peek_pointer, "p", gee_tree_set_value_range_collect_value, "p", gee_tree_set_value_range_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetRangeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_range_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetRange), 0, (GInstanceInitFunc) gee_tree_set_range_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_tree_set_range_type_id;
		gee_tree_set_range_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeTreeSetRange", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gee_tree_set_range_type_id__volatile, gee_tree_set_range_type_id);
	}
	return gee_tree_set_range_type_id__volatile;
}


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


static void gee_tree_set_range_unref (gpointer instance) {
	GeeTreeSetRange * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GEE_TREE_SET_RANGE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before) {
	GeeTreeSetSubSet * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	gconstpointer _tmp3_;
	gconstpointer _tmp4_;
	GeeTreeSetRange* _tmp5_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = set;
	_tmp3_ = after;
	_tmp4_ = before;
	_tmp5_ = gee_tree_set_range_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp2_, _tmp3_, _tmp4_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp5_;
	return self;
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before) {
	return gee_tree_set_sub_set_construct (GEE_TREE_SET_TYPE_SUB_SET, g_type, g_dup_func, g_destroy_func, set, after, before);
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before) {
	GeeTreeSetSubSet * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	gconstpointer _tmp3_;
	GeeTreeSetRange* _tmp4_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = set;
	_tmp3_ = before;
	_tmp4_ = gee_tree_set_range_new_head (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp2_, _tmp3_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp4_;
	return self;
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before) {
	return gee_tree_set_sub_set_construct_head (GEE_TREE_SET_TYPE_SUB_SET, g_type, g_dup_func, g_destroy_func, set, before);
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after) {
	GeeTreeSetSubSet * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	gconstpointer _tmp3_;
	GeeTreeSetRange* _tmp4_;
	g_return_val_if_fail (set != NULL, NULL);
	self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = set;
	_tmp3_ = after;
	_tmp4_ = gee_tree_set_range_new_tail (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp2_, _tmp3_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp4_;
	return self;
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after) {
	return gee_tree_set_sub_set_construct_tail (GEE_TREE_SET_TYPE_SUB_SET, g_type, g_dup_func, g_destroy_func, set, after);
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_from_range (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range) {
	GeeTreeSetSubSet * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSetRange* _tmp2_;
	GeeTreeSetRange* _tmp3_;
	g_return_val_if_fail (set != NULL, NULL);
	g_return_val_if_fail (range != NULL, NULL);
	self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = range;
	_tmp3_ = _gee_tree_set_range_ref0 (_tmp2_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp3_;
	return self;
}


static GeeTreeSetSubSet* gee_tree_set_sub_set_new_from_range (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range) {
	return gee_tree_set_sub_set_construct_from_range (GEE_TREE_SET_TYPE_SUB_SET, g_type, g_dup_func, g_destroy_func, set, range);
}


static gboolean gee_tree_set_sub_set_real_contains (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	gboolean _tmp3_;
	self = (GeeTreeSetSubSet*) base;
	_tmp1_ = self->range;
	_tmp2_ = item;
	_tmp3_ = gee_tree_set_range_in_range (_tmp1_, _tmp2_);
	if (_tmp3_) {
		GeeTreeSet* _tmp4_;
		gconstpointer _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->set;
		_tmp5_ = item;
		_tmp6_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp4_, _tmp5_);
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


static gboolean gee_tree_set_sub_set_real_add (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	gboolean _tmp3_;
	self = (GeeTreeSetSubSet*) base;
	_tmp1_ = self->range;
	_tmp2_ = item;
	_tmp3_ = gee_tree_set_range_in_range (_tmp1_, _tmp2_);
	if (_tmp3_) {
		GeeTreeSet* _tmp4_;
		gconstpointer _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->set;
		_tmp5_ = item;
		_tmp6_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp5_);
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


static gboolean gee_tree_set_sub_set_real_remove (GeeAbstractCollection* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	gboolean _tmp3_;
	self = (GeeTreeSetSubSet*) base;
	_tmp1_ = self->range;
	_tmp2_ = item;
	_tmp3_ = gee_tree_set_range_in_range (_tmp1_, _tmp2_);
	if (_tmp3_) {
		GeeTreeSet* _tmp4_;
		gconstpointer _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->set;
		_tmp5_ = item;
		_tmp6_ = gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp4_, _tmp5_);
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


static void gee_tree_set_sub_set_real_clear (GeeAbstractCollection* base) {
	GeeTreeSetSubSet * self;
	GeeIterator* iter = NULL;
	GeeIterator* _tmp0_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	iter = _tmp0_;
	while (TRUE) {
		GeeIterator* _tmp1_;
		gboolean _tmp2_;
		GeeIterator* _tmp3_;
		_tmp1_ = iter;
		_tmp2_ = gee_iterator_next (_tmp1_);
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = iter;
		gee_iterator_remove (_tmp3_);
	}
	_g_object_unref0 (iter);
}


static GeeIterator* gee_tree_set_sub_set_real_iterator (GeeAbstractCollection* base) {
	GeeTreeSetSubSet * self;
	GeeIterator* result = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSetRange* _tmp1_;
	GeeTreeSetSubIterator* _tmp2_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->set;
	_tmp1_ = self->range;
	_tmp2_ = gee_tree_set_sub_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_, _tmp1_);
	result = (GeeIterator*) _tmp2_;
	return result;
}


static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) {
	GeeTreeSetSubSet * self;
	GeeBidirIterator* result = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSetRange* _tmp1_;
	GeeTreeSetSubIterator* _tmp2_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->set;
	_tmp1_ = self->range;
	_tmp2_ = gee_tree_set_sub_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_, _tmp1_);
	result = (GeeBidirIterator*) _tmp2_;
	return result;
}


static gpointer gee_tree_set_sub_set_real_first (GeeAbstractSortedSet* base) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	GeeTreeSetNode* _first = NULL;
	GeeTreeSetRange* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = gee_tree_set_range_first (_tmp0_);
	_first = _tmp1_;
	_vala_assert (_first != NULL, "_first != null");
	_tmp2_ = _first->key;
	_tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	result = _tmp3_;
	return result;
}


static gpointer gee_tree_set_sub_set_real_last (GeeAbstractSortedSet* base) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	GeeTreeSetNode* _last = NULL;
	GeeTreeSetRange* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	gconstpointer _tmp2_;
	gpointer _tmp3_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = gee_tree_set_range_last (_tmp0_);
	_last = _tmp1_;
	_vala_assert (_last != NULL, "_last != null");
	_tmp2_ = _last->key;
	_tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
	result = _tmp3_;
	return result;
}


static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) {
	GeeTreeSetSubSet * self;
	GeeSortedSet* result = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	GeeTreeSetRange* _tmp3_;
	GeeTreeSetRange* _tmp4_;
	GeeTreeSetSubSet* _tmp5_;
	GeeSortedSet* _tmp6_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->set;
	_tmp1_ = self->range;
	_tmp2_ = before;
	_tmp3_ = gee_tree_set_range_cut_tail (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gee_tree_set_sub_set_new_from_range (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_, _tmp4_);
	_tmp6_ = (GeeSortedSet*) _tmp5_;
	_gee_tree_set_range_unref0 (_tmp4_);
	result = _tmp6_;
	return result;
}


static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) {
	GeeTreeSetSubSet * self;
	GeeSortedSet* result = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	GeeTreeSetRange* _tmp3_;
	GeeTreeSetRange* _tmp4_;
	GeeTreeSetSubSet* _tmp5_;
	GeeSortedSet* _tmp6_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->set;
	_tmp1_ = self->range;
	_tmp2_ = after;
	_tmp3_ = gee_tree_set_range_cut_head (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gee_tree_set_sub_set_new_from_range (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_, _tmp4_);
	_tmp6_ = (GeeSortedSet*) _tmp5_;
	_gee_tree_set_range_unref0 (_tmp4_);
	result = _tmp6_;
	return result;
}


static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) {
	GeeTreeSetSubSet * self;
	GeeSortedSet* result = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSetRange* _tmp1_;
	gconstpointer _tmp2_;
	gconstpointer _tmp3_;
	GeeTreeSetRange* _tmp4_;
	GeeTreeSetRange* _tmp5_;
	GeeTreeSetSubSet* _tmp6_;
	GeeSortedSet* _tmp7_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->set;
	_tmp1_ = self->range;
	_tmp2_ = after;
	_tmp3_ = before;
	_tmp4_ = gee_tree_set_range_cut (_tmp1_, _tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = gee_tree_set_sub_set_new_from_range (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_, _tmp5_);
	_tmp7_ = (GeeSortedSet*) _tmp6_;
	_gee_tree_set_range_unref0 (_tmp5_);
	result = _tmp7_;
	return result;
}


static GeeIterator* gee_tree_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	GeeIterator* result = NULL;
	GeeTreeSetRange* _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	GeeTreeSetNode* n = NULL;
	GeeTreeSet* _tmp3_;
	gconstpointer _tmp4_;
	GeeTreeSetNode* _tmp5_;
	GeeTreeSetNode* _tmp6_;
	GeeTreeSet* _tmp7_;
	GeeTreeSetRange* _tmp8_;
	GeeTreeSetNode* _tmp9_;
	GeeTreeSetSubIterator* _tmp10_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = item;
	_tmp2_ = gee_tree_set_range_in_range (_tmp0_, _tmp1_);
	if (!_tmp2_) {
		result = NULL;
		return result;
	}
	_tmp3_ = self->set;
	_tmp4_ = item;
	_tmp5_ = gee_tree_set_find_node (_tmp3_, _tmp4_);
	n = _tmp5_;
	_tmp6_ = n;
	if (_tmp6_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp7_ = self->set;
	_tmp8_ = self->range;
	_tmp9_ = n;
	_tmp10_ = gee_tree_set_sub_iterator_new_pointing (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp7_, _tmp8_, _tmp9_);
	result = (GeeIterator*) _tmp10_;
	return result;
}


static gpointer gee_tree_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	gint res = 0;
	GeeTreeSetRange* _tmp0_;
	gconstpointer _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gpointer l = NULL;
	GeeTreeSet* _tmp5_;
	gconstpointer _tmp6_;
	gpointer _tmp7_;
	gconstpointer _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	gconstpointer _tmp10_;
	gpointer _tmp15_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = item;
	_tmp2_ = gee_tree_set_range_compare_range (_tmp0_, _tmp1_);
	res = _tmp2_;
	_tmp3_ = res;
	if (_tmp3_ > 0) {
		gpointer _tmp4_;
		_tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->set;
	_tmp6_ = item;
	_tmp7_ = gee_abstract_sorted_set_lower ((GeeAbstractSortedSet*) _tmp5_, _tmp6_);
	l = _tmp7_;
	_tmp10_ = l;
	if (_tmp10_ != NULL) {
		GeeTreeSetRange* _tmp11_;
		gconstpointer _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->range;
		_tmp12_ = l;
		_tmp13_ = gee_tree_set_range_in_range (_tmp11_, _tmp12_);
		_tmp9_ = _tmp13_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		gconstpointer _tmp14_;
		_tmp14_ = l;
		_tmp8_ = _tmp14_;
	} else {
		_tmp8_ = NULL;
	}
	_tmp15_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
	result = _tmp15_;
	((l == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (l = (self->priv->g_destroy_func (l), NULL));
	return result;
}


static gpointer gee_tree_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	gint res = 0;
	GeeTreeSetRange* _tmp0_;
	gconstpointer _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gpointer h = NULL;
	GeeTreeSet* _tmp5_;
	gconstpointer _tmp6_;
	gpointer _tmp7_;
	gconstpointer _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	gconstpointer _tmp10_;
	gpointer _tmp15_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = item;
	_tmp2_ = gee_tree_set_range_compare_range (_tmp0_, _tmp1_);
	res = _tmp2_;
	_tmp3_ = res;
	if (_tmp3_ < 0) {
		gpointer _tmp4_;
		_tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->set;
	_tmp6_ = item;
	_tmp7_ = gee_abstract_sorted_set_higher ((GeeAbstractSortedSet*) _tmp5_, _tmp6_);
	h = _tmp7_;
	_tmp10_ = h;
	if (_tmp10_ != NULL) {
		GeeTreeSetRange* _tmp11_;
		gconstpointer _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->range;
		_tmp12_ = h;
		_tmp13_ = gee_tree_set_range_in_range (_tmp11_, _tmp12_);
		_tmp9_ = _tmp13_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		gconstpointer _tmp14_;
		_tmp14_ = h;
		_tmp8_ = _tmp14_;
	} else {
		_tmp8_ = NULL;
	}
	_tmp15_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
	result = _tmp15_;
	((h == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (h = (self->priv->g_destroy_func (h), NULL));
	return result;
}


static gpointer gee_tree_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	gint res = 0;
	GeeTreeSetRange* _tmp0_;
	gconstpointer _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gpointer l = NULL;
	GeeTreeSet* _tmp5_;
	gconstpointer _tmp6_;
	gpointer _tmp7_;
	gconstpointer _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	gconstpointer _tmp10_;
	gpointer _tmp15_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = item;
	_tmp2_ = gee_tree_set_range_compare_range (_tmp0_, _tmp1_);
	res = _tmp2_;
	_tmp3_ = res;
	if (_tmp3_ > 0) {
		gpointer _tmp4_;
		_tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->set;
	_tmp6_ = item;
	_tmp7_ = gee_abstract_sorted_set_floor ((GeeAbstractSortedSet*) _tmp5_, _tmp6_);
	l = _tmp7_;
	_tmp10_ = l;
	if (_tmp10_ != NULL) {
		GeeTreeSetRange* _tmp11_;
		gconstpointer _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->range;
		_tmp12_ = l;
		_tmp13_ = gee_tree_set_range_in_range (_tmp11_, _tmp12_);
		_tmp9_ = _tmp13_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		gconstpointer _tmp14_;
		_tmp14_ = l;
		_tmp8_ = _tmp14_;
	} else {
		_tmp8_ = NULL;
	}
	_tmp15_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
	result = _tmp15_;
	((l == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (l = (self->priv->g_destroy_func (l), NULL));
	return result;
}


static gpointer gee_tree_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item) {
	GeeTreeSetSubSet * self;
	gpointer result = NULL;
	gint res = 0;
	GeeTreeSetRange* _tmp0_;
	gconstpointer _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gpointer h = NULL;
	GeeTreeSet* _tmp5_;
	gconstpointer _tmp6_;
	gpointer _tmp7_;
	gconstpointer _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	gconstpointer _tmp10_;
	gpointer _tmp15_;
	self = (GeeTreeSetSubSet*) base;
	_tmp0_ = self->range;
	_tmp1_ = item;
	_tmp2_ = gee_tree_set_range_compare_range (_tmp0_, _tmp1_);
	res = _tmp2_;
	_tmp3_ = res;
	if (_tmp3_ < 0) {
		gpointer _tmp4_;
		_tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->set;
	_tmp6_ = item;
	_tmp7_ = gee_abstract_sorted_set_ceil ((GeeAbstractSortedSet*) _tmp5_, _tmp6_);
	h = _tmp7_;
	_tmp10_ = h;
	if (_tmp10_ != NULL) {
		GeeTreeSetRange* _tmp11_;
		gconstpointer _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->range;
		_tmp12_ = h;
		_tmp13_ = gee_tree_set_range_in_range (_tmp11_, _tmp12_);
		_tmp9_ = _tmp13_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		gconstpointer _tmp14_;
		_tmp14_ = h;
		_tmp8_ = _tmp14_;
	} else {
		_tmp8_ = NULL;
	}
	_tmp15_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
	result = _tmp15_;
	((h == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (h = (self->priv->g_destroy_func (h), NULL));
	return result;
}


static gint gee_tree_set_sub_set_real_get_size (GeeAbstractCollection* base) {
	gint result;
	GeeTreeSetSubSet* self;
	gint i = 0;
	GeeIterator* iterator = NULL;
	GeeIterator* _tmp0_;
	gint _tmp4_;
	self = (GeeTreeSetSubSet*) base;
	i = 0;
	_tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	iterator = _tmp0_;
	while (TRUE) {
		GeeIterator* _tmp1_;
		gboolean _tmp2_;
		gint _tmp3_;
		_tmp1_ = iterator;
		_tmp2_ = gee_iterator_next (_tmp1_);
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = i;
		i = _tmp3_ + 1;
	}
	_tmp4_ = i;
	result = _tmp4_;
	_g_object_unref0 (iterator);
	return result;
}


static gboolean gee_tree_set_sub_set_real_get_read_only (GeeAbstractCollection* base) {
	gboolean result;
	GeeTreeSetSubSet* self;
	self = (GeeTreeSetSubSet*) base;
	result = TRUE;
	return result;
}


static gboolean gee_tree_set_sub_set_get_is_empty (GeeTreeSetSubSet* self) {
	gboolean result;
	GeeTreeSetRange* _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->range;
	_tmp1_ = gee_tree_set_range_empty_subset (_tmp0_);
	result = _tmp1_;
	return result;
}


static void gee_tree_set_sub_set_class_init (GeeTreeSetSubSetClass * klass) {
	gee_tree_set_sub_set_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeTreeSetSubSetPrivate));
	((GeeAbstractCollectionClass *) klass)->contains = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_sub_set_real_contains;
	((GeeAbstractCollectionClass *) klass)->add = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_sub_set_real_add;
	((GeeAbstractCollectionClass *) klass)->remove = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_sub_set_real_remove;
	((GeeAbstractCollectionClass *) klass)->clear = (void (*) (GeeAbstractCollection *)) gee_tree_set_sub_set_real_clear;
	((GeeAbstractCollectionClass *) klass)->iterator = (GeeIterator* (*) (GeeAbstractCollection *)) gee_tree_set_sub_set_real_iterator;
	((GeeAbstractBidirSortedSetClass *) klass)->bidir_iterator = (GeeBidirIterator* (*) (GeeAbstractBidirSortedSet *)) gee_tree_set_sub_set_real_bidir_iterator;
	((GeeAbstractSortedSetClass *) klass)->first = (gpointer (*) (GeeAbstractSortedSet *)) gee_tree_set_sub_set_real_first;
	((GeeAbstractSortedSetClass *) klass)->last = (gpointer (*) (GeeAbstractSortedSet *)) gee_tree_set_sub_set_real_last;
	((GeeAbstractSortedSetClass *) klass)->head_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_head_set;
	((GeeAbstractSortedSetClass *) klass)->tail_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_tail_set;
	((GeeAbstractSortedSetClass *) klass)->sub_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer, gconstpointer)) gee_tree_set_sub_set_real_sub_set;
	((GeeAbstractSortedSetClass *) klass)->iterator_at = (GeeIterator* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_iterator_at;
	((GeeAbstractSortedSetClass *) klass)->lower = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_lower;
	((GeeAbstractSortedSetClass *) klass)->higher = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_higher;
	((GeeAbstractSortedSetClass *) klass)->floor = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_floor;
	((GeeAbstractSortedSetClass *) klass)->ceil = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_sub_set_real_ceil;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_set_sub_set_real_get_size;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_set_sub_set_real_get_read_only;
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_sub_set_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_sub_set_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_tree_set_sub_set_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_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_TREE_SET_SUB_SET_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_TREE_SET_SUB_SET_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_TREE_SET_SUB_SET_SIZE_PROPERTY, 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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_READ_ONLY_PROPERTY, 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_TREE_SET_SUB_SET_IS_EMPTY_PROPERTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gee_tree_set_sub_set_instance_init (GeeTreeSetSubSet * self) {
	self->priv = GEE_TREE_SET_SUB_SET_GET_PRIVATE (self);
}


static void gee_tree_set_sub_set_finalize (GObject * obj) {
	GeeTreeSetSubSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSet);
	_g_object_unref0 (self->set);
	_gee_tree_set_range_unref0 (self->range);
	G_OBJECT_CLASS (gee_tree_set_sub_set_parent_class)->finalize (obj);
}


static GType gee_tree_set_sub_set_get_type (void) {
	static volatile gsize gee_tree_set_sub_set_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_sub_set_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetSubSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_sub_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetSubSet), 0, (GInstanceInitFunc) gee_tree_set_sub_set_instance_init, NULL };
		GType gee_tree_set_sub_set_type_id;
		gee_tree_set_sub_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeSetSubSet", &g_define_type_info, 0);
		g_once_init_leave (&gee_tree_set_sub_set_type_id__volatile, gee_tree_set_sub_set_type_id);
	}
	return gee_tree_set_sub_set_type_id__volatile;
}


static void _vala_gee_tree_set_sub_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeTreeSetSubSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSet);
	switch (property_id) {
		case GEE_TREE_SET_SUB_SET_SIZE_PROPERTY:
		g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
		break;
		case GEE_TREE_SET_SUB_SET_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
		break;
		case GEE_TREE_SET_SUB_SET_IS_EMPTY_PROPERTY:
		g_value_set_boolean (value, gee_tree_set_sub_set_get_is_empty (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_tree_set_sub_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeTreeSetSubSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_SUB_SET, GeeTreeSetSubSet);
	switch (property_id) {
		case GEE_TREE_SET_SUB_SET_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_TREE_SET_SUB_SET_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_TREE_SET_SUB_SET_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 GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range) {
	GeeTreeSetSubIterator * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSetRange* _tmp2_;
	GeeTreeSetRange* _tmp3_;
	g_return_val_if_fail (set != NULL, NULL);
	g_return_val_if_fail (range != NULL, NULL);
	self = (GeeTreeSetSubIterator*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = range;
	_tmp3_ = _gee_tree_set_range_ref0 (_tmp2_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp3_;
	return self;
}


static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range) {
	return gee_tree_set_sub_iterator_construct (GEE_TREE_SET_TYPE_SUB_ITERATOR, g_type, g_dup_func, g_destroy_func, set, range);
}


static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node) {
	GeeTreeSetSubIterator * self = NULL;
	GeeTreeSet* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSetRange* _tmp2_;
	GeeTreeSetRange* _tmp3_;
	GeeTreeSet* _tmp4_;
	GeeTreeSetNode* _tmp5_;
	GeeTreeSetIterator* _tmp6_;
	g_return_val_if_fail (set != NULL, NULL);
	g_return_val_if_fail (range != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	self = (GeeTreeSetSubIterator*) 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_ = set;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->set);
	self->set = _tmp1_;
	_tmp2_ = range;
	_tmp3_ = _gee_tree_set_range_ref0 (_tmp2_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp3_;
	_tmp4_ = set;
	_tmp5_ = node;
	_tmp6_ = gee_tree_set_iterator_new_pointing (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp4_, _tmp5_);
	_g_object_unref0 (self->iterator);
	self->iterator = _tmp6_;
	return self;
}


static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node) {
	return gee_tree_set_sub_iterator_construct_pointing (GEE_TREE_SET_TYPE_SUB_ITERATOR, g_type, g_dup_func, g_destroy_func, set, range, node);
}


static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct_from_iterator (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetSubIterator* iter) {
	GeeTreeSetSubIterator * self = NULL;
	GeeTreeSetSubIterator* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* _tmp2_;
	GeeTreeSetSubIterator* _tmp3_;
	GeeTreeSetRange* _tmp4_;
	GeeTreeSetRange* _tmp5_;
	GeeTreeSetSubIterator* _tmp6_;
	GeeTreeSetIterator* _tmp7_;
	GeeTreeSetIterator* _tmp8_;
	g_return_val_if_fail (iter != NULL, NULL);
	self = (GeeTreeSetSubIterator*) 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_->set;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->set);
	self->set = _tmp2_;
	_tmp3_ = iter;
	_tmp4_ = _tmp3_->range;
	_tmp5_ = _gee_tree_set_range_ref0 (_tmp4_);
	_gee_tree_set_range_unref0 (self->range);
	self->range = _tmp5_;
	_tmp6_ = iter;
	_tmp7_ = _tmp6_->iterator;
	_tmp8_ = gee_tree_set_iterator_new_from_iterator (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp7_);
	_g_object_unref0 (self->iterator);
	self->iterator = _tmp8_;
	return self;
}


static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new_from_iterator (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSetSubIterator* iter) {
	return gee_tree_set_sub_iterator_construct_from_iterator (GEE_TREE_SET_TYPE_SUB_ITERATOR, g_type, g_dup_func, g_destroy_func, iter);
}


static gboolean gee_tree_set_sub_iterator_real_next (GeeIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetIterator* _tmp0_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	if (_tmp0_ != NULL) {
		gpointer next = NULL;
		gboolean _tmp1_ = FALSE;
		GeeTreeSetIterator* _tmp2_;
		gpointer _tmp3_ = NULL;
		gboolean _tmp4_;
		_tmp2_ = self->iterator;
		_tmp4_ = gee_tree_set_iterator_safe_next_get (_tmp2_, &_tmp3_);
		((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
		next = _tmp3_;
		if (_tmp4_) {
			GeeTreeSetRange* _tmp5_;
			gconstpointer _tmp6_;
			gboolean _tmp7_;
			_tmp5_ = self->range;
			_tmp6_ = next;
			_tmp7_ = gee_tree_set_range_in_range (_tmp5_, _tmp6_);
			_tmp1_ = _tmp7_;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			GeeTreeSetIterator* _tmp8_;
			gboolean _tmp9_;
			_tmp8_ = self->iterator;
			_tmp9_ = gee_iterator_next ((GeeIterator*) _tmp8_);
			_vala_assert (_tmp9_, "iterator.next ()");
			result = TRUE;
			((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
			return result;
		} else {
			result = FALSE;
			((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
			return result;
		}
		((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
	} else {
		gboolean _tmp10_;
		_tmp10_ = gee_bidir_iterator_first ((GeeBidirIterator*) self);
		result = _tmp10_;
		return result;
	}
}


static gboolean gee_tree_set_sub_iterator_real_has_next (GeeIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetIterator* _tmp0_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	if (_tmp0_ != NULL) {
		gpointer next = NULL;
		gboolean _tmp1_ = FALSE;
		GeeTreeSetIterator* _tmp2_;
		gpointer _tmp3_ = NULL;
		gboolean _tmp4_;
		_tmp2_ = self->iterator;
		_tmp4_ = gee_tree_set_iterator_safe_next_get (_tmp2_, &_tmp3_);
		((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
		next = _tmp3_;
		if (_tmp4_) {
			GeeTreeSetRange* _tmp5_;
			gconstpointer _tmp6_;
			gboolean _tmp7_;
			_tmp5_ = self->range;
			_tmp6_ = next;
			_tmp7_ = gee_tree_set_range_in_range (_tmp5_, _tmp6_);
			_tmp1_ = _tmp7_;
		} else {
			_tmp1_ = FALSE;
		}
		result = _tmp1_;
		((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL));
		return result;
	} else {
		GeeTreeSetRange* _tmp8_;
		GeeTreeSetNode* _tmp9_;
		_tmp8_ = self->range;
		_tmp9_ = gee_tree_set_range_first (_tmp8_);
		result = _tmp9_ != NULL;
		return result;
	}
}


static gboolean gee_tree_set_sub_iterator_real_first (GeeBidirIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetNode* node = NULL;
	GeeTreeSetRange* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSet* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetIterator* _tmp5_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->range;
	_tmp1_ = gee_tree_set_range_first (_tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->set;
	_tmp4_ = node;
	_tmp5_ = gee_tree_set_iterator_new_pointing (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp3_, _tmp4_);
	_g_object_unref0 (self->iterator);
	self->iterator = _tmp5_;
	result = TRUE;
	return result;
}


static gboolean gee_tree_set_sub_iterator_real_previous (GeeBidirIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetIterator* _tmp0_;
	gpointer prev = NULL;
	gboolean _tmp1_ = FALSE;
	GeeTreeSetIterator* _tmp2_;
	gpointer _tmp3_ = NULL;
	gboolean _tmp4_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->iterator;
	_tmp4_ = gee_tree_set_iterator_safe_previous_get (_tmp2_, &_tmp3_);
	((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
	prev = _tmp3_;
	if (_tmp4_) {
		GeeTreeSetRange* _tmp5_;
		gconstpointer _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->range;
		_tmp6_ = prev;
		_tmp7_ = gee_tree_set_range_in_range (_tmp5_, _tmp6_);
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GeeTreeSetIterator* _tmp8_;
		gboolean _tmp9_;
		_tmp8_ = self->iterator;
		_tmp9_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp8_);
		_vala_assert (_tmp9_, "iterator.previous ()");
		result = TRUE;
		((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
		return result;
	} else {
		result = FALSE;
		((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
		return result;
	}
	((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
}


static gboolean gee_tree_set_sub_iterator_real_has_previous (GeeBidirIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetIterator* _tmp0_;
	gpointer prev = NULL;
	gboolean _tmp1_ = FALSE;
	GeeTreeSetIterator* _tmp2_;
	gpointer _tmp3_ = NULL;
	gboolean _tmp4_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->iterator;
	_tmp4_ = gee_tree_set_iterator_safe_previous_get (_tmp2_, &_tmp3_);
	((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
	prev = _tmp3_;
	if (_tmp4_) {
		GeeTreeSetRange* _tmp5_;
		gconstpointer _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->range;
		_tmp6_ = prev;
		_tmp7_ = gee_tree_set_range_in_range (_tmp5_, _tmp6_);
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	((prev == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (prev = (self->priv->g_destroy_func (prev), NULL));
	return result;
}


static gboolean gee_tree_set_sub_iterator_real_last (GeeBidirIterator* base) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	GeeTreeSetNode* node = NULL;
	GeeTreeSetRange* _tmp0_;
	GeeTreeSetNode* _tmp1_;
	GeeTreeSetNode* _tmp2_;
	GeeTreeSet* _tmp3_;
	GeeTreeSetNode* _tmp4_;
	GeeTreeSetIterator* _tmp5_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->range;
	_tmp1_ = gee_tree_set_range_last (_tmp0_);
	node = _tmp1_;
	_tmp2_ = node;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->set;
	_tmp4_ = node;
	_tmp5_ = gee_tree_set_iterator_new_pointing (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp3_, _tmp4_);
	_g_object_unref0 (self->iterator);
	self->iterator = _tmp5_;
	result = TRUE;
	return result;
}


static gpointer gee_tree_set_sub_iterator_real_get (GeeIterator* base) {
	GeeTreeSetSubIterator * self;
	gpointer result = NULL;
	GeeTreeSetIterator* _tmp0_;
	GeeTreeSetIterator* _tmp1_;
	gpointer _tmp2_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	_vala_assert (_tmp0_ != NULL, "iterator != null");
	_tmp1_ = self->iterator;
	_tmp2_ = gee_iterator_get ((GeeIterator*) _tmp1_);
	result = _tmp2_;
	return result;
}


static void gee_tree_set_sub_iterator_real_remove (GeeIterator* base) {
	GeeTreeSetSubIterator * self;
	GeeTreeSetIterator* _tmp0_;
	GeeTreeSetIterator* _tmp1_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	_vala_assert (_tmp0_ != NULL, "iterator != null");
	_tmp1_ = self->iterator;
	gee_iterator_remove ((GeeIterator*) _tmp1_);
}


static gboolean gee_tree_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
	GeeTreeSetSubIterator * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GeeForallFunc _tmp2_;
		void* _tmp2__target;
		gpointer _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = f;
		_tmp2__target = f_target;
		_tmp3_ = gee_iterator_get ((GeeIterator*) self);
		_tmp4_ = _tmp2_ (_tmp3_, _tmp2__target);
		if (!_tmp4_) {
			result = FALSE;
			return result;
		}
	}
	while (TRUE) {
		gboolean _tmp5_;
		GeeForallFunc _tmp6_;
		void* _tmp6__target;
		gpointer _tmp7_;
		gboolean _tmp8_;
		_tmp5_ = gee_iterator_next ((GeeIterator*) self);
		if (!_tmp5_) {
			break;
		}
		_tmp6_ = f;
		_tmp6__target = f_target;
		_tmp7_ = gee_iterator_get ((GeeIterator*) self);
		_tmp8_ = _tmp6_ (_tmp7_, _tmp6__target);
		if (!_tmp8_) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}


static GeeIterator** gee_tree_set_sub_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1) {
	GeeTreeSetSubIterator * self;
	GeeIterator** result = NULL;
	guint _tmp0_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = forks;
	if (_tmp0_ == ((guint) 0)) {
		GeeIterator** _tmp1_;
		GeeIterator** _tmp2_;
		gint _tmp2__length1;
		_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_;
		GeeIterator** _tmp4_;
		gint _result__length1;
		gint __result__size_;
		GeeIterator** _tmp5_;
		gint _tmp5__length1;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator** _tmp16_;
		gint _tmp16__length1;
		_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_;
					guint _tmp11_;
					GeeIterator** _tmp12_;
					gint _tmp12__length1;
					guint _tmp13_;
					GeeTreeSetSubIterator* _tmp14_;
					GeeIterator* _tmp15_;
					if (!_tmp8_) {
						guint _tmp9_;
						_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_tree_set_sub_iterator_new_from_iterator (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) 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_tree_set_sub_iterator_real_get_read_only (GeeIterator* base) {
	gboolean result;
	GeeTreeSetSubIterator* self;
	self = (GeeTreeSetSubIterator*) base;
	result = FALSE;
	return result;
}


static gboolean gee_tree_set_sub_iterator_real_get_valid (GeeIterator* base) {
	gboolean result;
	GeeTreeSetSubIterator* self;
	GeeTreeSetIterator* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = (GeeTreeSetSubIterator*) base;
	_tmp0_ = self->iterator;
	_tmp1_ = gee_iterator_get_valid ((GeeIterator*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


static void gee_tree_set_sub_iterator_class_init (GeeTreeSetSubIteratorClass * klass) {
	gee_tree_set_sub_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeTreeSetSubIteratorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_sub_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_sub_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_tree_set_sub_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_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_TREE_SET_SUB_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_TREE_SET_SUB_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_TREE_SET_SUB_ITERATOR_READ_ONLY_PROPERTY, 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_TREE_SET_SUB_ITERATOR_VALID_PROPERTY, 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_tree_set_sub_iterator_gee_traversable_get_g_type (GeeTreeSetSubIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_tree_set_sub_iterator_gee_traversable_get_g_dup_func (GeeTreeSetSubIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_tree_set_sub_iterator_gee_traversable_get_g_destroy_func (GeeTreeSetSubIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_tree_set_sub_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
	gee_tree_set_sub_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*) (GeeTraversable *, GeeForallFunc, void*)) gee_tree_set_sub_iterator_real_foreach;
	iface->tee = (GeeIterator** (*) (GeeTraversable *, guint, int*)) gee_tree_set_sub_iterator_real_tee;
	iface->get_g_type = (GType (*) (GeeTraversable *)) gee_tree_set_sub_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeTraversable *)) gee_tree_set_sub_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeTraversable *)) gee_tree_set_sub_iterator_gee_traversable_get_g_destroy_func;
}


static void gee_tree_set_sub_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
	gee_tree_set_sub_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*) (GeeIterator *)) gee_tree_set_sub_iterator_real_next;
	iface->has_next = (gboolean (*) (GeeIterator *)) gee_tree_set_sub_iterator_real_has_next;
	iface->get = (gpointer (*) (GeeIterator *)) gee_tree_set_sub_iterator_real_get;
	iface->remove = (void (*) (GeeIterator *)) gee_tree_set_sub_iterator_real_remove;
	iface->get_read_only = gee_tree_set_sub_iterator_real_get_read_only;
	iface->get_valid = gee_tree_set_sub_iterator_real_get_valid;
}


static GType gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_type (GeeTreeSetSubIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeSetSubIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeSetSubIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_tree_set_sub_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) {
	gee_tree_set_sub_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->first = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_real_first;
	iface->previous = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_real_previous;
	iface->has_previous = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_real_has_previous;
	iface->last = (gboolean (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_real_last;
	iface->get_g_type = (GType (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeBidirIterator *)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_destroy_func;
}


static void gee_tree_set_sub_iterator_instance_init (GeeTreeSetSubIterator * self) {
	self->priv = GEE_TREE_SET_SUB_ITERATOR_GET_PRIVATE (self);
	self->iterator = NULL;
}


static void gee_tree_set_sub_iterator_finalize (GObject * obj) {
	GeeTreeSetSubIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIterator);
	_g_object_unref0 (self->set);
	_gee_tree_set_range_unref0 (self->range);
	_g_object_unref0 (self->iterator);
	G_OBJECT_CLASS (gee_tree_set_sub_iterator_parent_class)->finalize (obj);
}


static GType gee_tree_set_sub_iterator_get_type (void) {
	static volatile gsize gee_tree_set_sub_iterator_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_sub_iterator_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetSubIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_sub_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetSubIterator), 0, (GInstanceInitFunc) gee_tree_set_sub_iterator_instance_init, NULL };
		static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_tree_set_sub_iterator_type_id;
		gee_tree_set_sub_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeSetSubIterator", &g_define_type_info, 0);
		g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
		g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
		g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info);
		g_once_init_leave (&gee_tree_set_sub_iterator_type_id__volatile, gee_tree_set_sub_iterator_type_id);
	}
	return gee_tree_set_sub_iterator_type_id__volatile;
}


static void _vala_gee_tree_set_sub_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeTreeSetSubIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIterator);
	switch (property_id) {
		case GEE_TREE_SET_SUB_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		case GEE_TREE_SET_SUB_ITERATOR_VALID_PROPERTY:
		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_tree_set_sub_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeTreeSetSubIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIterator);
	switch (property_id) {
		case GEE_TREE_SET_SUB_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_TREE_SET_SUB_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_TREE_SET_SUB_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_tree_set_class_init (GeeTreeSetClass * klass) {
	gee_tree_set_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeTreeSetPrivate));
	((GeeAbstractCollectionClass *) klass)->contains = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_real_contains;
	((GeeAbstractCollectionClass *) klass)->add = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_real_add;
	((GeeAbstractCollectionClass *) klass)->remove = (gboolean (*) (GeeAbstractCollection *, gconstpointer)) gee_tree_set_real_remove;
	((GeeAbstractCollectionClass *) klass)->clear = (void (*) (GeeAbstractCollection *)) gee_tree_set_real_clear;
	((GeeAbstractCollectionClass *) klass)->foreach = (gboolean (*) (GeeAbstractCollection *, GeeForallFunc, void*)) gee_tree_set_real_foreach;
	((GeeAbstractCollectionClass *) klass)->iterator = (GeeIterator* (*) (GeeAbstractCollection *)) gee_tree_set_real_iterator;
	((GeeAbstractBidirSortedSetClass *) klass)->bidir_iterator = (GeeBidirIterator* (*) (GeeAbstractBidirSortedSet *)) gee_tree_set_real_bidir_iterator;
	((GeeAbstractSortedSetClass *) klass)->first = (gpointer (*) (GeeAbstractSortedSet *)) gee_tree_set_real_first;
	((GeeAbstractSortedSetClass *) klass)->last = (gpointer (*) (GeeAbstractSortedSet *)) gee_tree_set_real_last;
	((GeeAbstractSortedSetClass *) klass)->head_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_head_set;
	((GeeAbstractSortedSetClass *) klass)->tail_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_tail_set;
	((GeeAbstractSortedSetClass *) klass)->sub_set = (GeeSortedSet* (*) (GeeAbstractSortedSet *, gconstpointer, gconstpointer)) gee_tree_set_real_sub_set;
	((GeeAbstractSortedSetClass *) klass)->iterator_at = (GeeIterator* (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_iterator_at;
	((GeeAbstractSortedSetClass *) klass)->lower = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_lower;
	((GeeAbstractSortedSetClass *) klass)->higher = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_higher;
	((GeeAbstractSortedSetClass *) klass)->floor = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_floor;
	((GeeAbstractSortedSetClass *) klass)->ceil = (gpointer (*) (GeeAbstractSortedSet *, gconstpointer)) gee_tree_set_real_ceil;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_set_real_get_size;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_set_real_get_read_only;
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_tree_set_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_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_TREE_SET_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_TREE_SET_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_TREE_SET_SIZE_PROPERTY, 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));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_READ_ONLY_PROPERTY, 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));
}


static void gee_tree_set_instance_init (GeeTreeSet * self) {
	self->priv = GEE_TREE_SET_GET_PRIVATE (self);
	self->priv->_size = 0;
	self->priv->root = NULL;
	self->priv->_first = NULL;
	self->priv->_last = NULL;
	self->priv->stamp = 0;
}


static void gee_tree_set_finalize (GObject * obj) {
	GeeTreeSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TREE_SET, GeeTreeSet);
	gee_abstract_collection_clear ((GeeAbstractCollection*) self);
	_gee_tree_set_node_free0 (self->priv->root);
	_gee_functions_compare_data_func_closure_unref0 (self->priv->_compare_func);
	G_OBJECT_CLASS (gee_tree_set_parent_class)->finalize (obj);
}


/**
 * Left-leaning red-black tree implementation of the {@link Set} interface.
 *
 * This implementation is especially well designed for large quantity of
 * data. The (balanced) tree implementation insure that the set and get
 * methods are in logarithmic complexity. For a linear implementation see
 * {@link HashSet}.
 *
 * @see HashSet
 */
GType gee_tree_set_get_type (void) {
	static volatile gsize gee_tree_set_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tree_set_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSet), 0, (GInstanceInitFunc) gee_tree_set_instance_init, NULL };
		GType gee_tree_set_type_id;
		gee_tree_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeSet", &g_define_type_info, 0);
		g_once_init_leave (&gee_tree_set_type_id__volatile, gee_tree_set_type_id);
	}
	return gee_tree_set_type_id__volatile;
}


static void _vala_gee_tree_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeTreeSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_SET, GeeTreeSet);
	switch (property_id) {
		case GEE_TREE_SET_SIZE_PROPERTY:
		g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
		break;
		case GEE_TREE_SET_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_tree_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeTreeSet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_SET, GeeTreeSet);
	switch (property_id) {
		case GEE_TREE_SET_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_TREE_SET_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_TREE_SET_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);
}