/* traversable.c generated by valac 0.34.0.46-213c, the Vala compiler
 * generated from traversable.vala, do not modify */

/* traversable.vala
 *
 * Copyright (C) 2011-2012  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>


#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_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())

#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_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_STREAM_ITERATOR (gee_stream_iterator_get_type ())
#define GEE_STREAM_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_STREAM_ITERATOR, GeeStreamIterator))
#define GEE_STREAM_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_STREAM_ITERATOR, GeeStreamIteratorClass))
#define GEE_IS_STREAM_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_STREAM_ITERATOR))
#define GEE_IS_STREAM_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_STREAM_ITERATOR))
#define GEE_STREAM_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_STREAM_ITERATOR, GeeStreamIteratorClass))

typedef struct _GeeStreamIterator GeeStreamIterator;
typedef struct _GeeStreamIteratorClass GeeStreamIteratorClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _a_destroy_func0(var) (((var == NULL) || (a_destroy_func == NULL)) ? NULL : (var = (a_destroy_func (var), NULL)))
typedef struct _Block15Data Block15Data;
typedef struct _Block16Data Block16Data;
#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL)))
typedef struct _Block17Data Block17Data;
typedef struct _Block18Data Block18Data;
typedef struct _Block19Data Block19Data;
typedef struct _Block20Data Block20Data;
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;

#define GEE_TEE_ITERATOR_TYPE_NODE (gee_tee_iterator_node_get_type ())
#define GEE_TEE_ITERATOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNode))
#define GEE_TEE_ITERATOR_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNodeClass))
#define GEE_TEE_ITERATOR_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TEE_ITERATOR_TYPE_NODE))
#define GEE_TEE_ITERATOR_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TEE_ITERATOR_TYPE_NODE))
#define GEE_TEE_ITERATOR_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNodeClass))

typedef struct _GeeTeeIteratorNode GeeTeeIteratorNode;
typedef struct _GeeTeeIteratorNodeClass GeeTeeIteratorNodeClass;

#define GEE_TYPE_TEE_ITERATOR (gee_tee_iterator_get_type ())
#define GEE_TEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEE_ITERATOR, GeeTeeIterator))
#define GEE_TEE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEE_ITERATOR, GeeTeeIteratorClass))
#define GEE_IS_TEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEE_ITERATOR))
#define GEE_IS_TEE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEE_ITERATOR))
#define GEE_TEE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEE_ITERATOR, GeeTeeIteratorClass))

typedef struct _GeeTeeIterator GeeTeeIterator;
typedef struct _GeeTeeIteratorClass GeeTeeIteratorClass;
#define _gee_tee_iterator_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_tee_iterator_node_unref (var), NULL)))
#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 gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
typedef GeeLazy* (*GeeUnfoldFunc) (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);
typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
typedef gboolean (*GeePredicate) (gconstpointer g, 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 GeeIterator* (*GeeFlatMapFunc) (gpointer g, void* user_data);
struct _GeeTraversableIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeTraversable* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
	GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
	gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
	GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
	gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
	GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
	GType (*get_element_type) (GeeTraversable* self);
	GeeIterator* (*flat_map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFlatMapFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
	GeeIterator** (*tee) (GeeTraversable* self, guint forks, int* result_length1);
};

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

struct _Block15Data {
	int _ref_count_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeFoldFunc f;
	gpointer f_target;
	gpointer seed;
};

struct _Block16Data {
	int _ref_count_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeMapFunc f;
	gpointer f_target;
};

struct _Block17Data {
	int _ref_count_;
	Block16Data * _data16_;
	GeeLazy* item;
};

typedef gpointer (*GeeLazyFunc) (void* user_data);
struct _Block18Data {
	int _ref_count_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gboolean seed_emitted;
	GeeFoldFunc f;
	gpointer f_target;
	gpointer seed;
};

struct _Block19Data {
	int _ref_count_;
	Block18Data * _data18_;
	GeeLazy* item;
};

struct _Block20Data {
	int _ref_count_;
	GeeTraversable* self;
	GeePredicate pred;
	gpointer pred_target;
	GDestroyNotify pred_target_destroy_notify;
};

struct _Block21Data {
	int _ref_count_;
	GeeTraversable* self;
	gint offset;
	gint length;
};

struct _Block22Data {
	int _ref_count_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeIterator* current;
	GeeFlatMapFunc f;
	gpointer f_target;
	GDestroyNotify f_target_destroy_notify;
};

struct _Block23Data {
	int _ref_count_;
	Block22Data * _data22_;
};

struct _Block24Data {
	int _ref_count_;
	GeeTraversable* self;
	GeeIterator* _self_;
};



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_traversable_stream_get_type (void) G_GNUC_CONST;
GType gee_iterator_get_type (void) G_GNUC_CONST;
GType gee_traversable_get_type (void) G_GNUC_CONST;
gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target);
GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
static GeeIterator* gee_traversable_real_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
GType gee_iterable_get_type (void) G_GNUC_CONST;
G_GNUC_INTERNAL GeeStreamIterator* gee_stream_iterator_new (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* outer, GeeStreamFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeStreamIterator* gee_stream_iterator_construct (GType object_type, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* outer, GeeStreamFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GType gee_stream_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
GeeIterator* gee_iterable_iterator (GeeIterable* self);
gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
static gpointer gee_traversable_real_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static gboolean __lambda11_ (Block15Data* _data15_, gpointer item);
static gboolean ___lambda11__gee_forall_func (gpointer g, gpointer self);
GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
static GeeIterator* gee_traversable_real_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
static GeeTraversableStream __lambda12_ (Block16Data* _data16_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static gpointer ___lambda13_ (Block17Data* _data17_);
gpointer gee_lazy_get (GeeLazy* self);
static gpointer ____lambda13__gee_lazy_func (gpointer self);
GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
static GeeTraversableStream ___lambda12__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self);
GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
static GeeIterator* gee_traversable_real_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static GeeTraversableStream __lambda14_ (Block18Data* _data18_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item);
GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item);
static gpointer ___lambda15_ (Block19Data* _data19_);
static gpointer ____lambda15__gee_lazy_func (gpointer self);
static GeeTraversableStream ___lambda14__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self);
GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
static GeeIterator* gee_traversable_real_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static GeeTraversableStream __lambda16_ (Block20Data* _data20_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val);
static GeeTraversableStream ___lambda16__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self);
GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length);
static GeeIterator* gee_traversable_real_chop (GeeTraversable* self, gint offset, gint length);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static GeeTraversableStream __lambda17_ (Block21Data* _data21_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val);
static GeeTraversableStream ___lambda17__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self);
GeeIterator* gee_traversable_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);
static GeeIterator* gee_traversable_real_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);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static GeeTraversableStream __lambda18_ (Block22Data* _data22_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
gboolean gee_iterator_next (GeeIterator* self);
static gpointer ____lambda19_ (Block23Data* _data23_);
gpointer gee_iterator_get (GeeIterator* self);
static gpointer _____lambda19__gee_lazy_func (gpointer self);
gboolean gee_iterator_get_valid (GeeIterator* self);
static gpointer ____lambda20_ (Block23Data* _data23_);
static gpointer _____lambda20__gee_lazy_func (gpointer self);
static gpointer ____lambda21_ (Block23Data* _data23_);
static gpointer _____lambda21__gee_lazy_func (gpointer self);
static GeeTraversableStream ___lambda18__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self);
GeeIterator** gee_traversable_tee (GeeTraversable* self, guint forks, int* result_length1);
static GeeIterator** gee_traversable_real_tee (GeeTraversable* self, guint forks, int* result_length1);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static gpointer ______lambda22_ (Block24Data* _data24_);
static gpointer _______lambda22__gee_lazy_func (gpointer self);
G_GNUC_INTERNAL gpointer gee_tee_iterator_node_ref (gpointer instance);
G_GNUC_INTERNAL void gee_tee_iterator_node_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_tee_iterator_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
G_GNUC_INTERNAL void gee_tee_iterator_value_set_node (GValue* value, gpointer v_object) G_GNUC_UNUSED;
G_GNUC_INTERNAL void gee_tee_iterator_value_take_node (GValue* value, gpointer v_object);
G_GNUC_INTERNAL gpointer gee_tee_iterator_value_get_node (const GValue* value) G_GNUC_UNUSED;
G_GNUC_INTERNAL GType gee_tee_iterator_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
G_GNUC_INTERNAL GeeLazy* gee_tee_iterator_create_nodes (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator, GeeLazy* dependent);
G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next);
G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next);
G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid);
G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid);
G_GNUC_INTERNAL GType gee_tee_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
GType gee_traversable_get_element_type (GeeTraversable* self);
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);


GType gee_traversable_stream_get_type (void) {
	static volatile gsize gee_traversable_stream_type_id__volatile = 0;
	if (g_once_init_enter (&gee_traversable_stream_type_id__volatile)) {
		static const GEnumValue values[] = {{GEE_TRAVERSABLE_STREAM_YIELD, "GEE_TRAVERSABLE_STREAM_YIELD", "yield"}, {GEE_TRAVERSABLE_STREAM_CONTINUE, "GEE_TRAVERSABLE_STREAM_CONTINUE", "continue"}, {GEE_TRAVERSABLE_STREAM_END, "GEE_TRAVERSABLE_STREAM_END", "end"}, {GEE_TRAVERSABLE_STREAM_WAIT, "GEE_TRAVERSABLE_STREAM_WAIT", "wait"}, {0, NULL, NULL}};
		GType gee_traversable_stream_type_id;
		gee_traversable_stream_type_id = g_enum_register_static ("GeeTraversableStream", values);
		g_once_init_leave (&gee_traversable_stream_type_id__volatile, gee_traversable_stream_type_id);
	}
	return gee_traversable_stream_type_id__volatile;
}


/**
 * Apply function to each element returned by iterator untill last element
 * or function return ''false''.
 *
 * ''{@link Iterator} implementation:'' Operation moves the iterator
 * to last element in iteration or the first element that returned ''false''.
 * If iterator points at some element it will be included in iteration.
 *
 * @param f function applied to every element of the collection
 *
 * @return ''false'' if the argument returned ''false'' at last invocation and
 *         ''true'' otherwise.
 */
gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target) {
	g_return_val_if_fail (self != NULL, FALSE);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->foreach (self, f, f_target);
}


/**
 * Stream function is an abstract function allowing writing many
 * operations.
 *
 * The stream function accepts three parameter:
 *
 *   1. state. It is usually the last returned value from function but
 *      it may be {@link Stream.END} when {@link Stream.CONTINUE} was
 *      returned and there was no more elements.
 *   1. input. It is valid only if first argument is
 *      {@link Stream.CONTINUE}
 *   1. output. It is valid only if result is Stream.YIELD
 *
 * It may return one of 3 results:
 *
 *   1. {@link Stream.YIELD}. It means that value was yielded and can
 *      be passed to outgoing iterator.
 *   1. {@link Stream.CONTINUE}. It means that the function needs to be
 *      called with next element or with {@link Stream.END} if it is
 *      end of stream). If the state element was Stream.END during the
 *      current iteration function ''must not'' return {@link Stream.CONTINUE}.
 *   1. {@link Stream.WAIT}. Simply denotes that iterator should skip an element.
 *      Usually the function is called once again with {@link Stream.WAIT} as
 *      state however it do affect the initial validity of iterator.
 *   1. {@link Stream.END}. It means that the last argument was yielded.
 *
 * If the function yields the value immediately then the returning iterator
 * is {@link Iterator.valid} and points to this value as well as in case when the
 * parent iterator is {@link Iterator.valid} and function yields
 * after consuming 1 input. In other case returned iterator is invalid including
 * when the first value returned is {@link Stream.WAIT}.
 *
 * Note: In {@link Iterator} implementation: if iterator is
 *    {@link Iterator.valid} the current value should be fed
 *    immediately to function if during initial call function returns
 *    {@link Stream.CONTINUE}. The parent iterator cannot be used before
 *    the functions return {@link Stream.END} afterwards it points on the
 *    last element consumed.
 *
 * @param f function generating stream
 * @return iterator containing values yielded by stream
 */
static GeeIterator* gee_traversable_real_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) {
	GeeIterator* result = NULL;
	GeeIterator* _self_ = NULL;
	GeeIterable* iself = NULL;
	GeeIterator* _tmp0_ = NULL;
	_self_ = G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERATOR) ? ((GeeIterator*) self) : NULL;
	_tmp0_ = _self_;
	if (_tmp0_ != NULL) {
		GeeIterator* _tmp1_ = NULL;
		GeeStreamFunc _tmp2_ = NULL;
		void* _tmp2__target = NULL;
		GDestroyNotify _tmp2__target_destroy_notify = NULL;
		GeeStreamIterator* _tmp3_ = NULL;
		_tmp1_ = _self_;
		_tmp2_ = f;
		_tmp2__target = f_target;
		_tmp2__target_destroy_notify = f_target_destroy_notify;
		f_target_destroy_notify = NULL;
		_tmp3_ = gee_stream_iterator_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), _tmp1_, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
		result = (GeeIterator*) _tmp3_;
		(f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL);
		f = NULL;
		f_target = NULL;
		f_target_destroy_notify = NULL;
		return result;
	} else {
		GeeIterable* _tmp4_ = NULL;
		iself = G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERABLE) ? ((GeeIterable*) self) : NULL;
		_tmp4_ = iself;
		if (_tmp4_ != NULL) {
			GeeIterable* _tmp5_ = NULL;
			GeeIterator* _tmp6_ = NULL;
			GeeIterator* _tmp7_ = NULL;
			GeeStreamFunc _tmp8_ = NULL;
			void* _tmp8__target = NULL;
			GDestroyNotify _tmp8__target_destroy_notify = NULL;
			GeeIterator* _tmp9_ = NULL;
			GeeIterator* _tmp10_ = NULL;
			_tmp5_ = iself;
			_tmp6_ = gee_iterable_iterator (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = f;
			_tmp8__target = f_target;
			_tmp8__target_destroy_notify = f_target_destroy_notify;
			f_target_destroy_notify = NULL;
			_tmp9_ = gee_traversable_stream ((GeeTraversable*) _tmp7_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp8_, _tmp8__target, _tmp8__target_destroy_notify);
			_tmp10_ = _tmp9_;
			_g_object_unref0 (_tmp7_);
			result = _tmp10_;
			(f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL);
			f = NULL;
			f_target = NULL;
			f_target_destroy_notify = NULL;
			return result;
		} else {
			g_assert_not_reached ();
		}
	}
	(f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL);
	f = NULL;
	f_target = NULL;
	f_target_destroy_notify = NULL;
}


GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->stream (self, a_type, a_dup_func, a_destroy_func, f, f_target, f_target_destroy_notify);
}


/**
 * Standard aggregation function.
 *
 * It takes a function, seed and first element, returns the new seed and
 * progress to next element when the operation repeats.
 *
 * Note: Default implementation uses {@link foreach}.
 *
 * Note: In {@link Iterator} implementation operation moves the
 *    iterator to last element in iteration. If iterator is
 *    {@link Iterator.valid} the current element will be considered
 *    as well.
 *
 */
static Block15Data* block15_data_ref (Block15Data* _data15_) {
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}


static void block15_data_unref (void * _userdata_) {
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data15_->self;
		a_type = _data15_->a_type;
		a_dup_func = _data15_->a_dup_func;
		a_destroy_func = _data15_->a_destroy_func;
		_a_destroy_func0 (_data15_->seed);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}


static gboolean __lambda11_ (Block15Data* _data15_, gpointer item) {
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gboolean result = FALSE;
	GeeFoldFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	gpointer _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	self = _data15_->self;
	a_type = _data15_->a_type;
	a_dup_func = _data15_->a_dup_func;
	a_destroy_func = _data15_->a_destroy_func;
	_tmp0_ = _data15_->f;
	_tmp0__target = _data15_->f_target;
	_tmp1_ = item;
	item = NULL;
	_tmp2_ = _data15_->seed;
	_data15_->seed = NULL;
	_tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target);
	_a_destroy_func0 (_data15_->seed);
	_data15_->seed = _tmp3_;
	result = TRUE;
	((item == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
	return result;
}


static gboolean ___lambda11__gee_forall_func (gpointer g, gpointer self) {
	gboolean result;
	result = __lambda11_ (self, g);
	return result;
}


static gpointer gee_traversable_real_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) {
	gpointer result = NULL;
	Block15Data* _data15_;
	GeeFoldFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	gconstpointer _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_data15_->a_type = a_type;
	_data15_->a_dup_func = a_dup_func;
	_data15_->a_destroy_func = a_destroy_func;
	_tmp0_ = f;
	_tmp0__target = f_target;
	_data15_->f = _tmp0_;
	_data15_->f_target = _tmp0__target;
	_tmp1_ = seed;
	_a_destroy_func0 (_data15_->seed);
	_data15_->seed = _tmp1_;
	gee_traversable_foreach (self, ___lambda11__gee_forall_func, _data15_);
	_tmp2_ = _data15_->seed;
	_data15_->seed = NULL;
	result = _tmp2_;
	block15_data_unref (_data15_);
	_data15_ = NULL;
	return result;
}


gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->fold (self, a_type, a_dup_func, a_destroy_func, f, f_target, seed);
}


/**
 * Produces an iterator pointing at elements generated by function passed.
 *
 * Iterator is lazy evaluated but value is force-evaluated when
 * iterator moves to next element. ({@link Iterator.next})
 *
 * Note: Default implementation uses {@link stream}.
 *
 * Note: In {@link Iterator} implementation if the parent iterator is
 *    {@link Iterator.valid} so is the returned one. Using the parent
 *    iterator is not allowed before the inner iterator {@link Iterator.next}
 *    return false and then it points on its last element.
 *    The resulting iterator is {@link Iterator.valid} if the parent
 *    iterator is.
 *
 * @param f Mapping function
 * @return Iterator listing mapped value
 */
static Block16Data* block16_data_ref (Block16Data* _data16_) {
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}


static void block16_data_unref (void * _userdata_) {
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data16_->self;
		a_type = _data16_->a_type;
		a_dup_func = _data16_->a_dup_func;
		a_destroy_func = _data16_->a_destroy_func;
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}


static Block17Data* block17_data_ref (Block17Data* _data17_) {
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}


static void block17_data_unref (void * _userdata_) {
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data17_->_data16_->self;
		a_type = _data17_->_data16_->a_type;
		a_dup_func = _data17_->_data16_->a_dup_func;
		a_destroy_func = _data17_->_data16_->a_destroy_func;
		_gee_lazy_unref0 (_data17_->item);
		block16_data_unref (_data17_->_data16_);
		_data17_->_data16_ = NULL;
		g_slice_free (Block17Data, _data17_);
	}
}


static gpointer ___lambda13_ (Block17Data* _data17_) {
	Block16Data* _data16_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gpointer result = NULL;
	gpointer tmp = NULL;
	GeeLazy* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	GeeMapFunc _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	gpointer _tmp3_ = NULL;
	gpointer _tmp4_ = NULL;
	_data16_ = _data17_->_data16_;
	self = _data16_->self;
	a_type = _data16_->a_type;
	a_dup_func = _data16_->a_dup_func;
	a_destroy_func = _data16_->a_destroy_func;
	_tmp0_ = _data17_->item;
	_tmp1_ = gee_lazy_get (_tmp0_);
	tmp = _tmp1_;
	_gee_lazy_unref0 (_data17_->item);
	_data17_->item = NULL;
	_tmp2_ = _data16_->f;
	_tmp2__target = _data16_->f_target;
	_tmp3_ = tmp;
	tmp = NULL;
	_tmp4_ = _tmp2_ (_tmp3_, _tmp2__target);
	result = _tmp4_;
	_a_destroy_func0 (tmp);
	return result;
}


static gpointer ____lambda13__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ___lambda13_ (self);
	return result;
}


static GeeTraversableStream __lambda12_ (Block16Data* _data16_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) {
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeLazy* _vala_val = NULL;
	GeeTraversableStream result = 0;
	Block17Data* _data17_;
	GeeLazy* _tmp0_ = NULL;
	GeeTraversableStream _tmp1_ = 0;
	self = _data16_->self;
	a_type = _data16_->a_type;
	a_dup_func = _data16_->a_dup_func;
	a_destroy_func = _data16_->a_destroy_func;
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_data17_->_data16_ = block16_data_ref (_data16_);
	_tmp0_ = item;
	_gee_lazy_unref0 (_data17_->item);
	_data17_->item = _tmp0_;
	_tmp1_ = state;
	switch (_tmp1_) {
		case GEE_TRAVERSABLE_STREAM_YIELD:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_CONTINUE;
			block17_data_unref (_data17_);
			_data17_ = NULL;
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		case GEE_TRAVERSABLE_STREAM_CONTINUE:
		{
			GeeLazy* _tmp2_ = NULL;
			_tmp2_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ____lambda13__gee_lazy_func, block17_data_ref (_data17_), block17_data_unref);
			_gee_lazy_unref0 (_vala_val);
			_vala_val = _tmp2_;
			result = GEE_TRAVERSABLE_STREAM_YIELD;
			block17_data_unref (_data17_);
			_data17_ = NULL;
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		case GEE_TRAVERSABLE_STREAM_END:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_END;
			block17_data_unref (_data17_);
			_data17_ = NULL;
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	if (val) {
		*val = _vala_val;
	} else {
		_gee_lazy_unref0 (_vala_val);
	}
	block17_data_unref (_data17_);
	_data17_ = NULL;
}


static GeeTraversableStream ___lambda12__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) {
	GeeTraversableStream result;
	result = __lambda12_ (self, state, g, lazy);
	return result;
}


static GeeIterator* gee_traversable_real_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target) {
	GeeIterator* result = NULL;
	Block16Data* _data16_;
	GeeMapFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GeeIterator* _tmp1_ = NULL;
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_data16_->a_type = a_type;
	_data16_->a_dup_func = a_dup_func;
	_data16_->a_destroy_func = a_destroy_func;
	_tmp0_ = f;
	_tmp0__target = f_target;
	_data16_->f = _tmp0_;
	_data16_->f_target = _tmp0__target;
	_tmp1_ = gee_traversable_stream (self, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ___lambda12__gee_stream_func, block16_data_ref (_data16_), block16_data_unref);
	result = _tmp1_;
	block16_data_unref (_data16_);
	_data16_ = NULL;
	return result;
}


GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->map (self, a_type, a_dup_func, a_destroy_func, f, f_target);
}


/**
 * Creates a new iterator that is initially pointing to seed. Then
 * subsequent values are obtained after applying the function to previous
 * value and the subsequent items.
 *
 * The resulting iterator is always valid and it contains the seed value.
 *
 * Note: Default implementation uses {@link stream}.
 *
 * Note: When the method is called on {@link Iterator} using the parent
 *    iterator is not allowed befor the inner iterator
 *    {@link Iterator.next} return false and then it points on its last
 *    element. The resulting iterator is {@link Iterator.valid}.
 *
 * @param f Folding function
 * @param seed original seed value
 * @return Iterator containing values of subsequent values of seed
 */
static Block18Data* block18_data_ref (Block18Data* _data18_) {
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}


static void block18_data_unref (void * _userdata_) {
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data18_->self;
		a_type = _data18_->a_type;
		a_dup_func = _data18_->a_dup_func;
		a_destroy_func = _data18_->a_destroy_func;
		_a_destroy_func0 (_data18_->seed);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}


static Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data19_->_data18_->self;
		a_type = _data19_->_data18_->a_type;
		a_dup_func = _data19_->_data18_->a_dup_func;
		a_destroy_func = _data19_->_data18_->a_destroy_func;
		_gee_lazy_unref0 (_data19_->item);
		block18_data_unref (_data19_->_data18_);
		_data19_->_data18_ = NULL;
		g_slice_free (Block19Data, _data19_);
	}
}


static gpointer ___lambda15_ (Block19Data* _data19_) {
	Block18Data* _data18_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gpointer result = NULL;
	gpointer tmp = NULL;
	GeeLazy* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	GeeFoldFunc _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	gpointer _tmp3_ = NULL;
	gpointer _tmp4_ = NULL;
	gpointer _tmp5_ = NULL;
	gconstpointer _tmp6_ = NULL;
	gpointer _tmp7_ = NULL;
	_data18_ = _data19_->_data18_;
	self = _data18_->self;
	a_type = _data18_->a_type;
	a_dup_func = _data18_->a_dup_func;
	a_destroy_func = _data18_->a_destroy_func;
	_tmp0_ = _data19_->item;
	_tmp1_ = gee_lazy_get (_tmp0_);
	tmp = _tmp1_;
	_gee_lazy_unref0 (_data19_->item);
	_data19_->item = NULL;
	_tmp2_ = _data18_->f;
	_tmp2__target = _data18_->f_target;
	_tmp3_ = tmp;
	tmp = NULL;
	_tmp4_ = _data18_->seed;
	_data18_->seed = NULL;
	_tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target);
	_a_destroy_func0 (_data18_->seed);
	_data18_->seed = _tmp5_;
	_tmp6_ = _data18_->seed;
	_tmp7_ = ((_tmp6_ != NULL) && (a_dup_func != NULL)) ? a_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_);
	result = _tmp7_;
	_a_destroy_func0 (tmp);
	return result;
}


static gpointer ____lambda15__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ___lambda15_ (self);
	return result;
}


static GeeTraversableStream __lambda14_ (Block18Data* _data18_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) {
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeLazy* _vala_val = NULL;
	GeeTraversableStream result = 0;
	Block19Data* _data19_;
	GeeLazy* _tmp0_ = NULL;
	GeeTraversableStream _tmp1_ = 0;
	self = _data18_->self;
	a_type = _data18_->a_type;
	a_dup_func = _data18_->a_dup_func;
	a_destroy_func = _data18_->a_destroy_func;
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->_data18_ = block18_data_ref (_data18_);
	_tmp0_ = item;
	_gee_lazy_unref0 (_data19_->item);
	_data19_->item = _tmp0_;
	_tmp1_ = state;
	switch (_tmp1_) {
		case GEE_TRAVERSABLE_STREAM_YIELD:
		{
			if (_data18_->seed_emitted) {
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				block19_data_unref (_data19_);
				_data19_ = NULL;
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				gconstpointer _tmp2_ = NULL;
				GeeLazy* _tmp3_ = NULL;
				_tmp2_ = _data18_->seed;
				_tmp3_ = gee_lazy_new_from_value (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp2_);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp3_;
				_data18_->seed_emitted = TRUE;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				block19_data_unref (_data19_);
				_data19_ = NULL;
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
		}
		case GEE_TRAVERSABLE_STREAM_CONTINUE:
		{
			GeeLazy* _tmp4_ = NULL;
			_tmp4_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ____lambda15__gee_lazy_func, block19_data_ref (_data19_), block19_data_unref);
			_gee_lazy_unref0 (_vala_val);
			_vala_val = _tmp4_;
			result = GEE_TRAVERSABLE_STREAM_YIELD;
			block19_data_unref (_data19_);
			_data19_ = NULL;
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		case GEE_TRAVERSABLE_STREAM_END:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_END;
			block19_data_unref (_data19_);
			_data19_ = NULL;
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	if (val) {
		*val = _vala_val;
	} else {
		_gee_lazy_unref0 (_vala_val);
	}
	block19_data_unref (_data19_);
	_data19_ = NULL;
}


static GeeTraversableStream ___lambda14__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) {
	GeeTraversableStream result;
	result = __lambda14_ (self, state, g, lazy);
	return result;
}


static GeeIterator* gee_traversable_real_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) {
	GeeIterator* result = NULL;
	Block18Data* _data18_;
	GeeFoldFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	gconstpointer _tmp1_ = NULL;
	GeeIterator* _tmp2_ = NULL;
	_data18_ = g_slice_new0 (Block18Data);
	_data18_->_ref_count_ = 1;
	_data18_->self = g_object_ref (self);
	_data18_->a_type = a_type;
	_data18_->a_dup_func = a_dup_func;
	_data18_->a_destroy_func = a_destroy_func;
	_tmp0_ = f;
	_tmp0__target = f_target;
	_data18_->f = _tmp0_;
	_data18_->f_target = _tmp0__target;
	_tmp1_ = seed;
	_a_destroy_func0 (_data18_->seed);
	_data18_->seed = _tmp1_;
	_data18_->seed_emitted = FALSE;
	_tmp2_ = gee_traversable_stream (self, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ___lambda14__gee_stream_func, block18_data_ref (_data18_), block18_data_unref);
	result = _tmp2_;
	block18_data_unref (_data18_);
	_data18_ = NULL;
	return result;
}


GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->scan (self, a_type, a_dup_func, a_destroy_func, f, f_target, seed);
}


/**
 * Creates a new iterator that contains only values that fullfills the
 * predicate.
 *
 * Note: When the method is called on {@link Iterator} using the parent
 *    iterator is not allowed befor the inner iterator
 *    {@link Iterator.next} return false and then it points on its last
 *    element. The resulting iterator is {@link Iterator.valid} if parent
 *    iterator is {@link Iterator.valid} and value it is pointing on
 *    fullfills the predicate.
 *
 * @param pred predicate to check should the value be retained
 * @return Iterator containing values of subsequent values of seed
 */
static Block20Data* block20_data_ref (Block20Data* _data20_) {
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}


static void block20_data_unref (void * _userdata_) {
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		GeeTraversable* self;
		self = _data20_->self;
		(_data20_->pred_target_destroy_notify == NULL) ? NULL : (_data20_->pred_target_destroy_notify (_data20_->pred_target), NULL);
		_data20_->pred = NULL;
		_data20_->pred_target = NULL;
		_data20_->pred_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}


static gpointer _gee_lazy_ref0 (gpointer self) {
	return self ? gee_lazy_ref (self) : NULL;
}


static GeeTraversableStream __lambda16_ (Block20Data* _data20_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) {
	GeeTraversable* self;
	GeeLazy* _vala_val = NULL;
	GeeTraversableStream result = 0;
	GeeTraversableStream _tmp0_ = 0;
	self = _data20_->self;
	_tmp0_ = state;
	switch (_tmp0_) {
		case GEE_TRAVERSABLE_STREAM_YIELD:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_CONTINUE;
			_gee_lazy_unref0 (item);
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		case GEE_TRAVERSABLE_STREAM_CONTINUE:
		{
			gpointer g = NULL;
			GeeLazy* _tmp1_ = NULL;
			gpointer _tmp2_ = NULL;
			GeePredicate _tmp3_ = NULL;
			void* _tmp3__target = NULL;
			gconstpointer _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			_tmp1_ = item;
			_tmp2_ = gee_lazy_get (_tmp1_);
			g = _tmp2_;
			_tmp3_ = _data20_->pred;
			_tmp3__target = _data20_->pred_target;
			_tmp4_ = g;
			_tmp5_ = _tmp3_ (_tmp4_, _tmp3__target);
			if (_tmp5_) {
				GeeLazy* _tmp6_ = NULL;
				GeeLazy* _tmp7_ = NULL;
				_tmp6_ = item;
				_tmp7_ = _gee_lazy_ref0 (_tmp6_);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp7_;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL));
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL));
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
			((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL));
		}
		case GEE_TRAVERSABLE_STREAM_END:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_END;
			_gee_lazy_unref0 (item);
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_gee_lazy_unref0 (item);
	if (val) {
		*val = _vala_val;
	} else {
		_gee_lazy_unref0 (_vala_val);
	}
}


static GeeTraversableStream ___lambda16__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) {
	GeeTraversableStream result;
	result = __lambda16_ (self, state, g, lazy);
	return result;
}


static GeeIterator* gee_traversable_real_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify) {
	GeeIterator* result = NULL;
	Block20Data* _data20_;
	GeePredicate _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GeeIterator* _tmp1_ = NULL;
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = pred;
	_tmp0__target = pred_target;
	(_data20_->pred_target_destroy_notify == NULL) ? NULL : (_data20_->pred_target_destroy_notify (_data20_->pred_target), NULL);
	_data20_->pred = NULL;
	_data20_->pred_target = NULL;
	_data20_->pred_target_destroy_notify = NULL;
	_data20_->pred = _tmp0_;
	_data20_->pred_target = _tmp0__target;
	_data20_->pred_target_destroy_notify = pred_target_destroy_notify;
	_tmp1_ = gee_traversable_stream (self, GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ___lambda16__gee_stream_func, block20_data_ref (_data20_), block20_data_unref);
	result = _tmp1_;
	block20_data_unref (_data20_);
	_data20_ = NULL;
	return result;
}


GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->filter (self, pred, pred_target, pred_target_destroy_notify);
}


/**
 * Creates a new iterator which contains elements from iterable. The
 * first argument states the offset i.e. number of elements the iterator
 * skips by default.
 *
 * Note: In {@link Iterator} implementation resulting iterator is
 *    {@link Iterator.valid} when parent iterator is
 *    {@link Iterator.valid} and the offset is 0. Using the parent
 *    iterator is not allowed before the inner iterator
 *    {@link Iterator.next} return false and then it points on its last
 *    element.
 *
 * @param offset the offset to first element the iterator is pointing to
 * @param length maximum number of elements iterator may return. Negative
 *        value means that the number is unbounded
 */
static Block21Data* block21_data_ref (Block21Data* _data21_) {
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}


static void block21_data_unref (void * _userdata_) {
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		GeeTraversable* self;
		self = _data21_->self;
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static GeeTraversableStream __lambda17_ (Block21Data* _data21_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) {
	GeeTraversable* self;
	GeeLazy* _vala_val = NULL;
	GeeTraversableStream result = 0;
	GeeTraversableStream _tmp0_ = 0;
	self = _data21_->self;
	_tmp0_ = state;
	switch (_tmp0_) {
		case GEE_TRAVERSABLE_STREAM_YIELD:
		{
			gint _tmp1_ = 0;
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			_tmp1_ = _data21_->offset;
			if (_tmp1_ > 0) {
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				gint _tmp2_ = 0;
				_tmp2_ = _data21_->length;
				if (_tmp2_ > 0) {
					GeeTraversableStream _tmp3_ = 0;
					gint _tmp4_ = 0;
					_tmp4_ = _data21_->length;
					if (_tmp4_ != 0) {
						_tmp3_ = GEE_TRAVERSABLE_STREAM_CONTINUE;
					} else {
						_tmp3_ = GEE_TRAVERSABLE_STREAM_END;
					}
					result = _tmp3_;
					_gee_lazy_unref0 (item);
					if (val) {
						*val = _vala_val;
					} else {
						_gee_lazy_unref0 (_vala_val);
					}
					return result;
				} else {
					gint _tmp5_ = 0;
					_tmp5_ = _data21_->length;
					if (_tmp5_ == 0) {
						result = GEE_TRAVERSABLE_STREAM_END;
						_gee_lazy_unref0 (item);
						if (val) {
							*val = _vala_val;
						} else {
							_gee_lazy_unref0 (_vala_val);
						}
						return result;
					} else {
						result = GEE_TRAVERSABLE_STREAM_CONTINUE;
						_gee_lazy_unref0 (item);
						if (val) {
							*val = _vala_val;
						} else {
							_gee_lazy_unref0 (_vala_val);
						}
						return result;
					}
				}
			}
		}
		case GEE_TRAVERSABLE_STREAM_CONTINUE:
		{
			gint _tmp6_ = 0;
			_tmp6_ = _data21_->offset;
			if (_tmp6_ == 0) {
				GeeLazy* _tmp7_ = NULL;
				GeeLazy* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				_tmp7_ = item;
				_tmp8_ = _gee_lazy_ref0 (_tmp7_);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp8_;
				_tmp9_ = _data21_->length;
				_data21_->length = _tmp9_ - 1;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				gint _tmp10_ = 0;
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				_tmp10_ = _data21_->offset;
				_data21_->offset = _tmp10_ - 1;
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
		}
		case GEE_TRAVERSABLE_STREAM_END:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_END;
			_gee_lazy_unref0 (item);
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_gee_lazy_unref0 (item);
	if (val) {
		*val = _vala_val;
	} else {
		_gee_lazy_unref0 (_vala_val);
	}
}


static GeeTraversableStream ___lambda17__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) {
	GeeTraversableStream result;
	result = __lambda17_ (self, state, g, lazy);
	return result;
}


static GeeIterator* gee_traversable_real_chop (GeeTraversable* self, gint offset, gint length) {
	GeeIterator* result = NULL;
	Block21Data* _data21_;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GeeIterator* _tmp3_ = NULL;
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = offset;
	_data21_->offset = _tmp0_;
	_tmp1_ = length;
	_data21_->length = _tmp1_;
	_tmp2_ = _data21_->offset;
	_vala_assert (_tmp2_ >= 0, "offset >= 0");
	_tmp3_ = gee_traversable_stream (self, GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ___lambda17__gee_stream_func, block21_data_ref (_data21_), block21_data_unref);
	result = _tmp3_;
	block21_data_unref (_data21_);
	_data21_ = NULL;
	return result;
}


GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->chop (self, offset, length);
}


/**
 * A fused concatinate and map. The function is applied to each element
 * of iteration and the resulting values are concatinated.
 *
 * The iterator is lazy evaluated but value is force-evaluated when
 * iterator is moved to next value.
 *
 * Note: Default implementation uses {@link stream}.
 *
 * Note: In {@link Iterator} implementation if the parent iterator is
 *    {@link Iterator.valid} and function returns a valid iterator the
 *    resulting iterator is also valid. Using the parent iterator is not
 *    allowed before the inner iterator {@link Iterator.next}
 *    return false and then it points on its last element.
 *
 * @since 0.11.1
 * @param f mapping function
 * @return Iterator over returned values
 */
static Block22Data* block22_data_ref (Block22Data* _data22_) {
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}


static void block22_data_unref (void * _userdata_) {
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data22_->self;
		a_type = _data22_->a_type;
		a_dup_func = _data22_->a_dup_func;
		a_destroy_func = _data22_->a_destroy_func;
		_g_object_unref0 (_data22_->current);
		(_data22_->f_target_destroy_notify == NULL) ? NULL : (_data22_->f_target_destroy_notify (_data22_->f_target), NULL);
		_data22_->f = NULL;
		_data22_->f_target = NULL;
		_data22_->f_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		GeeTraversable* self;
		GType a_type;
		GBoxedCopyFunc a_dup_func;
		GDestroyNotify a_destroy_func;
		self = _data23_->_data22_->self;
		a_type = _data23_->_data22_->a_type;
		a_dup_func = _data23_->_data22_->a_dup_func;
		a_destroy_func = _data23_->_data22_->a_destroy_func;
		block22_data_unref (_data23_->_data22_);
		_data23_->_data22_ = NULL;
		g_slice_free (Block23Data, _data23_);
	}
}


static gpointer ____lambda19_ (Block23Data* _data23_) {
	Block22Data* _data22_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gpointer result = NULL;
	gpointer _tmp0_ = NULL;
	_data22_ = _data23_->_data22_;
	self = _data22_->self;
	a_type = _data22_->a_type;
	a_dup_func = _data22_->a_dup_func;
	a_destroy_func = _data22_->a_destroy_func;
	_tmp0_ = gee_iterator_get (_data22_->current);
	result = _tmp0_;
	return result;
}


static gpointer _____lambda19__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ____lambda19_ (self);
	return result;
}


static gpointer ____lambda20_ (Block23Data* _data23_) {
	Block22Data* _data22_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gpointer result = NULL;
	gpointer _tmp0_ = NULL;
	_data22_ = _data23_->_data22_;
	self = _data22_->self;
	a_type = _data22_->a_type;
	a_dup_func = _data22_->a_dup_func;
	a_destroy_func = _data22_->a_destroy_func;
	_tmp0_ = gee_iterator_get (_data22_->current);
	result = _tmp0_;
	return result;
}


static gpointer _____lambda20__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ____lambda20_ (self);
	return result;
}


static gpointer ____lambda21_ (Block23Data* _data23_) {
	Block22Data* _data22_;
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	gpointer result = NULL;
	gpointer _tmp0_ = NULL;
	_data22_ = _data23_->_data22_;
	self = _data22_->self;
	a_type = _data22_->a_type;
	a_dup_func = _data22_->a_dup_func;
	a_destroy_func = _data22_->a_destroy_func;
	_tmp0_ = gee_iterator_get (_data22_->current);
	result = _tmp0_;
	return result;
}


static gpointer _____lambda21__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ____lambda21_ (self);
	return result;
}


static GeeTraversableStream __lambda18_ (Block22Data* _data22_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) {
	GeeTraversable* self;
	GType a_type;
	GBoxedCopyFunc a_dup_func;
	GDestroyNotify a_destroy_func;
	GeeLazy* _vala_val = NULL;
	GeeTraversableStream result = 0;
	Block23Data* _data23_;
	GeeTraversableStream _tmp0_ = 0;
	self = _data22_->self;
	a_type = _data22_->a_type;
	a_dup_func = _data22_->a_dup_func;
	a_destroy_func = _data22_->a_destroy_func;
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->_data22_ = block22_data_ref (_data22_);
	_tmp0_ = state;
	switch (_tmp0_) {
		case GEE_TRAVERSABLE_STREAM_YIELD:
		{
			gboolean _tmp1_ = FALSE;
			if (_data22_->current == NULL) {
				_tmp1_ = TRUE;
			} else {
				gboolean _tmp2_ = FALSE;
				_tmp2_ = gee_iterator_next (_data22_->current);
				_tmp1_ = !_tmp2_;
			}
			if (_tmp1_) {
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				GeeLazy* _tmp3_ = NULL;
				_tmp3_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _____lambda19__gee_lazy_func, block23_data_ref (_data23_), block23_data_unref);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp3_;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
		}
		case GEE_TRAVERSABLE_STREAM_CONTINUE:
		{
			GeeFlatMapFunc _tmp4_ = NULL;
			void* _tmp4__target = NULL;
			GeeLazy* _tmp5_ = NULL;
			gpointer _tmp6_ = NULL;
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_ = FALSE;
			_tmp4_ = _data22_->f;
			_tmp4__target = _data22_->f_target;
			_tmp5_ = item;
			_tmp6_ = gee_lazy_get (_tmp5_);
			_tmp7_ = _tmp4_ (_tmp6_, _tmp4__target);
			_g_object_unref0 (_data22_->current);
			_data22_->current = _tmp7_;
			_tmp8_ = gee_iterator_get_valid (_data22_->current);
			_tmp9_ = _tmp8_;
			if (_tmp9_) {
				GeeLazy* _tmp10_ = NULL;
				_tmp10_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _____lambda20__gee_lazy_func, block23_data_ref (_data23_), block23_data_unref);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp10_;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				result = GEE_TRAVERSABLE_STREAM_WAIT;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
		}
		case GEE_TRAVERSABLE_STREAM_WAIT:
		{
			gboolean _tmp11_ = FALSE;
			_tmp11_ = gee_iterator_next (_data22_->current);
			if (_tmp11_) {
				GeeLazy* _tmp12_ = NULL;
				_tmp12_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _____lambda21__gee_lazy_func, block23_data_ref (_data23_), block23_data_unref);
				_gee_lazy_unref0 (_vala_val);
				_vala_val = _tmp12_;
				result = GEE_TRAVERSABLE_STREAM_YIELD;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			} else {
				_gee_lazy_unref0 (_vala_val);
				_vala_val = NULL;
				result = GEE_TRAVERSABLE_STREAM_CONTINUE;
				block23_data_unref (_data23_);
				_data23_ = NULL;
				_gee_lazy_unref0 (item);
				if (val) {
					*val = _vala_val;
				} else {
					_gee_lazy_unref0 (_vala_val);
				}
				return result;
			}
		}
		case GEE_TRAVERSABLE_STREAM_END:
		{
			_gee_lazy_unref0 (_vala_val);
			_vala_val = NULL;
			result = GEE_TRAVERSABLE_STREAM_END;
			block23_data_unref (_data23_);
			_data23_ = NULL;
			_gee_lazy_unref0 (item);
			if (val) {
				*val = _vala_val;
			} else {
				_gee_lazy_unref0 (_vala_val);
			}
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_gee_lazy_unref0 (item);
	if (val) {
		*val = _vala_val;
	} else {
		_gee_lazy_unref0 (_vala_val);
	}
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static GeeTraversableStream ___lambda18__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) {
	GeeTraversableStream result;
	result = __lambda18_ (self, state, g, lazy);
	return result;
}


static GeeIterator* gee_traversable_real_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* result = NULL;
	Block22Data* _data22_;
	GeeFlatMapFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GeeIterator* _tmp1_ = NULL;
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_data22_->a_type = a_type;
	_data22_->a_dup_func = a_dup_func;
	_data22_->a_destroy_func = a_destroy_func;
	_tmp0_ = f;
	_tmp0__target = f_target;
	(_data22_->f_target_destroy_notify == NULL) ? NULL : (_data22_->f_target_destroy_notify (_data22_->f_target), NULL);
	_data22_->f = NULL;
	_data22_->f_target = NULL;
	_data22_->f_target_destroy_notify = NULL;
	_data22_->f = _tmp0_;
	_data22_->f_target = _tmp0__target;
	_data22_->f_target_destroy_notify = f_target_destroy_notify;
	_data22_->current = NULL;
	_tmp1_ = gee_traversable_stream (self, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ___lambda18__gee_stream_func, block22_data_ref (_data22_), block22_data_unref);
	result = _tmp1_;
	block22_data_unref (_data22_);
	_data22_ = NULL;
	return result;
}


GeeIterator* gee_traversable_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) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->flat_map (self, a_type, a_dup_func, a_destroy_func, f, f_target, f_target_destroy_notify);
}


/**
 * Splits the traversable into multiple ones, caching the result if needed.
 *
 * Note: In {@link Iterator} implementation using the parent iterator is
 *   not allowed. However if any of the forked iterators {@link next}
 *   return false then it is treated as if the parent iterator
 *   {@link next} returned false.
 *
 * Note: The returned arrey might contain parent iterator if it is allowed
 *   by implementation. For example the iteration over collection does
 *   not need to generate and cache the results.
 *   In such case it is recommended to return the value as the first element
 *   of the array. This allows the consumer to check just the first element
 *   if it can perform optimizations for such case. However it //must// not
 *   depend on the order (that's for optimization only).
 *
 * Note: The resulting iterators does not need to be thread safe.
 *
 * @param forks Number of iterators in array
 * @return An array with created iterators
 * @since 0.11.5
 */
static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		GeeTraversable* self;
		self = _data24_->self;
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


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


static gpointer ______lambda22_ (Block24Data* _data24_) {
	GeeTraversable* self;
	gpointer result = NULL;
	GeeIterator* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	self = _data24_->self;
	_tmp0_ = _data24_->_self_;
	_tmp1_ = gee_iterator_get (_tmp0_);
	result = _tmp1_;
	return result;
}


static gpointer _______lambda22__gee_lazy_func (gpointer self) {
	gpointer result;
	result = ______lambda22_ (self);
	return result;
}


static GeeIterator** gee_traversable_real_tee (GeeTraversable* self, guint forks, int* result_length1) {
	GeeIterator** result = NULL;
	Block24Data* _data24_;
	GeeIterable* iself = NULL;
	GeeIterator* _tmp0_ = NULL;
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_data24_->_self_ = G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERATOR) ? ((GeeIterator*) self) : NULL;
	_tmp0_ = _data24_->_self_;
	if (_tmp0_ != NULL) {
		guint _tmp1_ = 0U;
		_tmp1_ = forks;
		if (_tmp1_ == ((guint) 0)) {
			GeeIterator** _tmp2_ = NULL;
			GeeIterator** _tmp3_ = NULL;
			gint _tmp3__length1 = 0;
			_tmp2_ = g_new0 (GeeIterator*, 0 + 1);
			_tmp3_ = _tmp2_;
			_tmp3__length1 = 0;
			if (result_length1) {
				*result_length1 = _tmp3__length1;
			}
			result = _tmp3_;
			block24_data_unref (_data24_);
			_data24_ = NULL;
			return result;
		} else {
			guint _tmp4_ = 0U;
			_tmp4_ = forks;
			if (_tmp4_ == ((guint) 1)) {
				GeeIterator* _tmp5_ = NULL;
				GeeIterator* _tmp6_ = NULL;
				GeeIterator** _tmp7_ = NULL;
				GeeIterator** _tmp8_ = NULL;
				gint _tmp8__length1 = 0;
				_tmp5_ = _data24_->_self_;
				_tmp6_ = _g_object_ref0 (_tmp5_);
				_tmp7_ = g_new0 (GeeIterator*, 1 + 1);
				_tmp7_[0] = _tmp6_;
				_tmp8_ = _tmp7_;
				_tmp8__length1 = 1;
				if (result_length1) {
					*result_length1 = _tmp8__length1;
				}
				result = _tmp8_;
				block24_data_unref (_data24_);
				_data24_ = NULL;
				return result;
			} else {
				GeeIterator** _result_ = NULL;
				guint _tmp9_ = 0U;
				GeeIterator** _tmp10_ = NULL;
				gint _result__length1 = 0;
				gint __result__size_ = 0;
				GeeLazy* data = NULL;
				gboolean is_valid = FALSE;
				GeeIterator* _tmp11_ = NULL;
				gboolean _tmp12_ = FALSE;
				gboolean _tmp13_ = FALSE;
				gboolean _tmp14_ = FALSE;
				GeeTeeIteratorNode* head = NULL;
				GeeLazy* _tmp17_ = NULL;
				GeeLazy* _tmp18_ = NULL;
				GeeIterator* _tmp19_ = NULL;
				GeeLazy* _tmp20_ = NULL;
				GeeLazy* _tmp21_ = NULL;
				GeeTeeIteratorNode* _tmp22_ = NULL;
				GeeIterator** _tmp33_ = NULL;
				gint _tmp33__length1 = 0;
				_tmp9_ = forks;
				_tmp10_ = g_new0 (GeeIterator*, _tmp9_ + 1);
				_result_ = _tmp10_;
				_result__length1 = _tmp9_;
				__result__size_ = _result__length1;
				_tmp11_ = _data24_->_self_;
				_tmp12_ = gee_iterator_get_valid (_tmp11_);
				_tmp13_ = _tmp12_;
				is_valid = _tmp13_;
				_tmp14_ = is_valid;
				if (_tmp14_) {
					GeeLazy* _tmp15_ = NULL;
					_tmp15_ = gee_lazy_new (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), _______lambda22__gee_lazy_func, block24_data_ref (_data24_), block24_data_unref);
					_gee_lazy_unref0 (data);
					data = _tmp15_;
				} else {
					GeeLazy* _tmp16_ = NULL;
					_tmp16_ = gee_lazy_new_from_value (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), NULL);
					_gee_lazy_unref0 (data);
					data = _tmp16_;
				}
				_tmp17_ = data;
				_tmp18_ = _gee_lazy_ref0 (_tmp17_);
				_tmp19_ = _data24_->_self_;
				_tmp20_ = data;
				_tmp21_ = gee_tee_iterator_create_nodes (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), _tmp19_, _tmp20_);
				_tmp22_ = gee_tee_iterator_node_new (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), _tmp18_, _tmp21_);
				head = _tmp22_;
				{
					guint i = 0U;
					i = (guint) 0;
					{
						gboolean _tmp23_ = FALSE;
						_tmp23_ = TRUE;
						while (TRUE) {
							guint _tmp25_ = 0U;
							guint _tmp26_ = 0U;
							GeeIterator** _tmp27_ = NULL;
							gint _tmp27__length1 = 0;
							guint _tmp28_ = 0U;
							GeeTeeIteratorNode* _tmp29_ = NULL;
							gboolean _tmp30_ = FALSE;
							GeeTeeIterator* _tmp31_ = NULL;
							GeeIterator* _tmp32_ = NULL;
							if (!_tmp23_) {
								guint _tmp24_ = 0U;
								_tmp24_ = i;
								i = _tmp24_ + 1;
							}
							_tmp23_ = FALSE;
							_tmp25_ = i;
							_tmp26_ = forks;
							if (!(_tmp25_ < _tmp26_)) {
								break;
							}
							_tmp27_ = _result_;
							_tmp27__length1 = _result__length1;
							_tmp28_ = i;
							_tmp29_ = head;
							_tmp30_ = is_valid;
							_tmp31_ = gee_tee_iterator_new (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), _tmp29_, _tmp30_);
							_g_object_unref0 (_tmp27_[_tmp28_]);
							_tmp27_[_tmp28_] = (GeeIterator*) _tmp31_;
							_tmp32_ = _tmp27_[_tmp28_];
						}
					}
				}
				_tmp33_ = _result_;
				_tmp33__length1 = _result__length1;
				if (result_length1) {
					*result_length1 = _tmp33__length1;
				}
				result = _tmp33_;
				_gee_tee_iterator_node_unref0 (head);
				_gee_lazy_unref0 (data);
				block24_data_unref (_data24_);
				_data24_ = NULL;
				return result;
			}
		}
	} else {
		GeeIterable* _tmp34_ = NULL;
		iself = G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERABLE) ? ((GeeIterable*) self) : NULL;
		_tmp34_ = iself;
		if (_tmp34_ != NULL) {
			GeeIterator** _result_ = NULL;
			guint _tmp35_ = 0U;
			GeeIterator** _tmp36_ = NULL;
			gint _result__length1 = 0;
			gint __result__size_ = 0;
			GeeIterator** _tmp46_ = NULL;
			gint _tmp46__length1 = 0;
			_tmp35_ = forks;
			_tmp36_ = g_new0 (GeeIterator*, _tmp35_ + 1);
			_result_ = _tmp36_;
			_result__length1 = _tmp35_;
			__result__size_ = _result__length1;
			{
				guint i = 0U;
				i = (guint) 0;
				{
					gboolean _tmp37_ = FALSE;
					_tmp37_ = TRUE;
					while (TRUE) {
						guint _tmp39_ = 0U;
						guint _tmp40_ = 0U;
						GeeIterator** _tmp41_ = NULL;
						gint _tmp41__length1 = 0;
						guint _tmp42_ = 0U;
						GeeIterable* _tmp43_ = NULL;
						GeeIterator* _tmp44_ = NULL;
						GeeIterator* _tmp45_ = NULL;
						if (!_tmp37_) {
							guint _tmp38_ = 0U;
							_tmp38_ = i;
							i = _tmp38_ + 1;
						}
						_tmp37_ = FALSE;
						_tmp39_ = i;
						_tmp40_ = forks;
						if (!(_tmp39_ < _tmp40_)) {
							break;
						}
						_tmp41_ = _result_;
						_tmp41__length1 = _result__length1;
						_tmp42_ = i;
						_tmp43_ = iself;
						_tmp44_ = gee_iterable_iterator (_tmp43_);
						_g_object_unref0 (_tmp41_[_tmp42_]);
						_tmp41_[_tmp42_] = _tmp44_;
						_tmp45_ = _tmp41_[_tmp42_];
					}
				}
			}
			_tmp46_ = _result_;
			_tmp46__length1 = _result__length1;
			if (result_length1) {
				*result_length1 = _tmp46__length1;
			}
			result = _tmp46_;
			block24_data_unref (_data24_);
			_data24_ = NULL;
			return result;
		} else {
			g_assert_not_reached ();
		}
	}
	block24_data_unref (_data24_);
	_data24_ = NULL;
}


GeeIterator** gee_traversable_tee (GeeTraversable* self, guint forks, int* result_length1) {
	g_return_val_if_fail (self != NULL, NULL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->tee (self, forks, result_length1);
}


GType gee_traversable_get_element_type (GeeTraversable* self) {
	g_return_val_if_fail (self != NULL, 0UL);
	return GEE_TRAVERSABLE_GET_INTERFACE (self)->get_element_type (self);
}


static GType gee_traversable_real_get_element_type (GeeTraversable* base) {
	GType result;
	GeeTraversable* self;
	self = base;
	result = GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self);
	return result;
}


static void gee_traversable_base_init (GeeTraversableIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		iface->stream = gee_traversable_real_stream;
		iface->fold = gee_traversable_real_fold;
		iface->map = gee_traversable_real_map;
		iface->scan = gee_traversable_real_scan;
		iface->filter = gee_traversable_real_filter;
		iface->chop = gee_traversable_real_chop;
		iface->flat_map = gee_traversable_real_flat_map;
		iface->tee = gee_traversable_real_tee;
		iface->get_element_type = gee_traversable_real_get_element_type;
	}
}


/**
 * It's a common interface for {@link Iterator} and {@link Iterable}. It
 * provides a fast, high level functions.
 *
 * ''{@link Iterator} implementation:'' Please note that most of the functions
 * affect the state of the iterator by moving it forward.
 * Even if the iterator is {@link BidirIterator} it ''must not''
 * rewind the state.
 *
 * ''{@link Iterable} implementation:'' validy ({@link Iterator.valid})
 * of returned iterator is the same as for invalid
 * iterator. In other words the following code is semantically equivalent:
 *
 * {{{
 *     var x = iterable.function (args);
 *     var x = iterable.iterator ().function(args);
 * }}}
 *
 * @since 0.7.0
 */
GType gee_traversable_get_type (void) {
	static volatile gsize gee_traversable_type_id__volatile = 0;
	if (g_once_init_enter (&gee_traversable_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTraversableIface), (GBaseInitFunc) gee_traversable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType gee_traversable_type_id;
		gee_traversable_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeTraversable", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (gee_traversable_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&gee_traversable_type_id__volatile, gee_traversable_type_id);
	}
	return gee_traversable_type_id__volatile;
}


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);
}



