/* stanza_reader.c generated by valac 0.56.19, the Vala compiler
 * generated from stanza_reader.vala, do not modify */

#include "xmpp-vala.h"
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_namespace_state_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_namespace_state_unref (var), NULL)))
#define _xmpp_stanza_reader_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_reader_unref (var), NULL)))
typedef struct _XmppStanzaReaderUpdateBufferData XmppStanzaReaderUpdateBufferData;
typedef struct _XmppStanzaReaderReadSingleData XmppStanzaReaderReadSingleData;
typedef struct _XmppStanzaReaderPeekSingleData XmppStanzaReaderPeekSingleData;
typedef struct _XmppStanzaReaderSkipUntilNonWsData XmppStanzaReaderSkipUntilNonWsData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _XmppStanzaReaderReadUntilWsData XmppStanzaReaderReadUntilWsData;
typedef struct _XmppStanzaReaderReadUntilCharOrWsData XmppStanzaReaderReadUntilCharOrWsData;
typedef struct _XmppStanzaReaderReadUntilCharData XmppStanzaReaderReadUntilCharData;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppStanzaReaderReadAttributeData XmppStanzaReaderReadAttributeData;
typedef struct _XmppStanzaReaderReadNodeStartData XmppStanzaReaderReadNodeStartData;
typedef struct _XmppStanzaReaderReadTextNodeData XmppStanzaReaderReadTextNodeData;
typedef struct _XmppStanzaReaderReadRootNodeData XmppStanzaReaderReadRootNodeData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _XmppStanzaReaderReadStanzaNodeData XmppStanzaReaderReadStanzaNodeData;
typedef struct _XmppStanzaReaderReadNodeData XmppStanzaReaderReadNodeData;
typedef struct _XmppParamSpecStanzaReader XmppParamSpecStanzaReader;

struct _XmppStanzaReaderPrivate {
	GInputStream* input;
	guint8* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	gint buffer_fill;
	gint buffer_pos;
	GCancellable* cancellable;
	XmppNamespaceState* ns_state;
};

struct _XmppStanzaReaderUpdateBufferData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	GInputStream* input;
	GInputStream* _tmp0_;
	GInputStream* _tmp1_;
	GInputStream* _tmp2_;
	GError* _tmp3_;
	gboolean _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	GError* _tmp7_;
	gssize _tmp8_;
	GInputStream* _tmp9_;
	guint8* _tmp10_;
	gint _tmp10__length1;
	GCancellable* _tmp11_;
	GError* _tmp12_;
	GError* _tmp13_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadSingleData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	gchar result;
	guint8* _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_;
	guint8 _tmp2_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderPeekSingleData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	gchar result;
	guint8* _tmp0_;
	gint _tmp0__length1;
	guint8 _tmp1_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderSkipUntilNonWsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	guint8* _tmp0_;
	gint _tmp0__length1;
	guint8 _tmp1_;
	gint _tmp2_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadUntilWsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	gchar* result;
	GString* res;
	GString* _tmp0_;
	guint8* _tmp1_;
	gint _tmp1__length1;
	guint8 _tmp2_;
	GString* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	gint _tmp5_;
	guint8 _tmp6_;
	GString* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadUntilCharOrWsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	gchar x;
	gchar y;
	gchar* result;
	GString* res;
	GString* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	guint8* _tmp3_;
	gint _tmp3__length1;
	guint8 _tmp4_;
	guint8* _tmp5_;
	gint _tmp5__length1;
	guint8 _tmp6_;
	guint8* _tmp7_;
	gint _tmp7__length1;
	guint8 _tmp8_;
	GString* _tmp9_;
	guint8* _tmp10_;
	gint _tmp10__length1;
	gint _tmp11_;
	guint8 _tmp12_;
	GString* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadUntilCharData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	gchar x;
	gchar* result;
	GString* res;
	GString* _tmp0_;
	guint8* _tmp1_;
	gint _tmp1__length1;
	guint8 _tmp2_;
	GString* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	gint _tmp5_;
	guint8 _tmp6_;
	GString* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadAttributeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaAttribute* result;
	XmppStanzaAttribute* res;
	XmppStanzaAttribute* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	XmppStanzaAttribute* _tmp3_;
	gchar* _tmp4_;
	gchar _tmp5_;
	gchar quot;
	gboolean _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	XmppStanzaAttribute* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	XmppStanzaAttribute* _tmp12_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadNodeStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaNode* result;
	XmppStanzaNode* res;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	GeeArrayList* _tmp2_;
	gboolean eof;
	gchar _tmp3_;
	gchar _tmp4_;
	XmppStanzaNode* _tmp5_;
	gchar _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	XmppStanzaNode* _tmp9_;
	gchar* _tmp10_;
	gchar _tmp11_;
	XmppStanzaNode* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	XmppStanzaNode* _tmp17_;
	gchar* _tmp18_;
	gchar next_char;
	gboolean _tmp19_;
	gboolean _tmp20_;
	XmppStanzaAttribute* _tmp21_;
	XmppStanzaAttribute* _tmp22_;
	XmppStanzaNode* _tmp23_;
	GeeList* _tmp24_;
	gchar _tmp25_;
	gboolean _tmp26_;
	gchar _tmp27_;
	XmppStanzaNode* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* _tmp30_;
	XmppStanzaNode* _tmp31_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadTextNodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaNode* result;
	XmppStanzaNode* res;
	XmppStanzaNode* _tmp0_;
	gchar* _tmp1_;
	XmppNamespaceState* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadRootNodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaNode* result;
	gchar _tmp0_;
	XmppStanzaNode* res;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	GError* _tmp6_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadStanzaNodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaNode* result;
	XmppNamespaceState* _tmp0_;
	XmppNamespaceState* _tmp1_;
	XmppStanzaNode* res;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	gboolean finish_node_seen;
	XmppStanzaNode* text_node;
	gboolean _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	gchar _tmp8_;
	gchar _tmp9_;
	gchar* desc;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar** split;
	const gchar* _tmp12_;
	gchar** _tmp13_;
	gchar** _tmp14_;
	gint split_length1;
	gint _split_size_;
	gchar* _tmp15_;
	XmppNamespaceState* _tmp16_;
	XmppStanzaNode* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	const gchar* _tmp21_;
	GError* _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	const gchar* _tmp24_;
	XmppStanzaNode* _tmp25_;
	const gchar* _tmp26_;
	GError* _tmp27_;
	XmppNamespaceState* _tmp28_;
	const gchar* _tmp29_;
	XmppStanzaNode* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	XmppStanzaNode* _tmp34_;
	const gchar* _tmp35_;
	GError* _tmp36_;
	XmppStanzaNode* _tmp37_;
	XmppStanzaNode* _tmp38_;
	XmppStanzaNode* _tmp39_;
	GeeList* _tmp40_;
	XmppStanzaNode* _tmp41_;
	GeeList* _tmp42_;
	gint _tmp43_;
	gint _tmp44_;
	gboolean _tmp45_;
	XmppStanzaNode* _tmp46_;
	XmppStanzaNode* _tmp47_;
	const gchar* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
	XmppStanzaNode* _tmp51_;
	XmppStanzaNode* _tmp52_;
	GeeList* _tmp53_;
	XmppStanzaNode* _tmp54_;
	XmppNamespaceState* _tmp55_;
	XmppNamespaceState* _tmp56_;
	GError* e;
	guint8* buffer_cpy;
	guint8* _tmp57_;
	gint _tmp57__length1;
	guint8* _tmp58_;
	gint buffer_cpy_length1;
	gint _buffer_cpy_size_;
	guint8* _tmp59_;
	gint _tmp59__length1;
	guint8* _tmp60_;
	gint _tmp60__length1;
	guint8* _tmp61_;
	gint _tmp61__length1;
	guint8* _tmp62_;
	gint _tmp62__length1;
	gchar* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	GError* _tmp67_;
	GError* _tmp68_;
	GError* _inner_error0_;
};

struct _XmppStanzaReaderReadNodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppStanzaReader* self;
	XmppStanzaNode* result;
	gchar _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	GError* _inner_error0_;
};

struct _XmppParamSpecStanzaReader {
	GParamSpec parent_instance;
};

static gint XmppStanzaReader_private_offset;
static gpointer xmpp_stanza_reader_parent_class = NULL;
static gint xmpp_stanza_reader_BUFFER_MAX;
static gint xmpp_stanza_reader_BUFFER_MAX = 4096;

static guint8* _vala_array_dup1 (guint8* self,
                          gssize length);
static void xmpp_stanza_reader_update_buffer_data_free (gpointer _data);
static void xmpp_stanza_reader_update_buffer (XmppStanzaReader* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void xmpp_stanza_reader_update_buffer_finish (XmppStanzaReader* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static gboolean xmpp_stanza_reader_update_buffer_co (XmppStanzaReaderUpdateBufferData* _data_);
static void xmpp_stanza_reader_update_buffer_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void xmpp_stanza_reader_read_single_data_free (gpointer _data);
static void xmpp_stanza_reader_read_single (XmppStanzaReader* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static gchar xmpp_stanza_reader_read_single_finish (XmppStanzaReader* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean xmpp_stanza_reader_read_single_co (XmppStanzaReaderReadSingleData* _data_);
static void xmpp_stanza_reader_read_single_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void xmpp_stanza_reader_peek_single_data_free (gpointer _data);
static void xmpp_stanza_reader_peek_single (XmppStanzaReader* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static gchar xmpp_stanza_reader_peek_single_finish (XmppStanzaReader* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean xmpp_stanza_reader_peek_single_co (XmppStanzaReaderPeekSingleData* _data_);
static void xmpp_stanza_reader_peek_single_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static gboolean xmpp_stanza_reader_is_ws (XmppStanzaReader* self,
                                   guint8 what);
static void xmpp_stanza_reader_skip_single (XmppStanzaReader* self);
static void xmpp_stanza_reader_skip_until_non_ws_data_free (gpointer _data);
static void xmpp_stanza_reader_skip_until_non_ws (XmppStanzaReader* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void xmpp_stanza_reader_skip_until_non_ws_finish (XmppStanzaReader* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean xmpp_stanza_reader_skip_until_non_ws_co (XmppStanzaReaderSkipUntilNonWsData* _data_);
static void xmpp_stanza_reader_skip_until_non_ws_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void xmpp_stanza_reader_read_until_ws_data_free (gpointer _data);
static void xmpp_stanza_reader_read_until_ws (XmppStanzaReader* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static gchar* xmpp_stanza_reader_read_until_ws_finish (XmppStanzaReader* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static gboolean xmpp_stanza_reader_read_until_ws_co (XmppStanzaReaderReadUntilWsData* _data_);
static void xmpp_stanza_reader_read_until_ws_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void xmpp_stanza_reader_read_until_char_or_ws_data_free (gpointer _data);
static void xmpp_stanza_reader_read_until_char_or_ws (XmppStanzaReader* self,
                                               gchar x,
                                               gchar y,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static gchar* xmpp_stanza_reader_read_until_char_or_ws_finish (XmppStanzaReader* self,
                                                        GAsyncResult* _res_,
                                                        GError** error);
static gboolean xmpp_stanza_reader_read_until_char_or_ws_co (XmppStanzaReaderReadUntilCharOrWsData* _data_);
static void xmpp_stanza_reader_read_until_char_or_ws_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void xmpp_stanza_reader_read_until_char_data_free (gpointer _data);
static void xmpp_stanza_reader_read_until_char (XmppStanzaReader* self,
                                         gchar x,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gchar* xmpp_stanza_reader_read_until_char_finish (XmppStanzaReader* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean xmpp_stanza_reader_read_until_char_co (XmppStanzaReaderReadUntilCharData* _data_);
static void xmpp_stanza_reader_read_until_char_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void xmpp_stanza_reader_read_attribute_data_free (gpointer _data);
static void xmpp_stanza_reader_read_attribute (XmppStanzaReader* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static XmppStanzaAttribute* xmpp_stanza_reader_read_attribute_finish (XmppStanzaReader* self,
                                                               GAsyncResult* _res_,
                                                               GError** error);
static gboolean xmpp_stanza_reader_read_attribute_co (XmppStanzaReaderReadAttributeData* _data_);
VALA_EXTERN XmppStanzaAttribute* xmpp_stanza_attribute_new (void);
VALA_EXTERN XmppStanzaAttribute* xmpp_stanza_attribute_construct (GType object_type);
static void xmpp_stanza_reader_read_attribute_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void xmpp_stanza_reader_handle_entry_ns (XmppStanzaReader* self,
                                         XmppStanzaEntry* entry,
                                         const gchar* default_uri,
                                         GError** error);
static void xmpp_stanza_reader_handle_stanza_ns (XmppStanzaReader* self,
                                          XmppStanzaNode* res,
                                          GError** error);
static void xmpp_stanza_reader_read_node_start_data_free (gpointer _data);
static gboolean xmpp_stanza_reader_read_node_start_co (XmppStanzaReaderReadNodeStartData* _data_);
VALA_EXTERN XmppStanzaNode* xmpp_stanza_node_new (void);
VALA_EXTERN XmppStanzaNode* xmpp_stanza_node_construct (GType object_type);
static void xmpp_stanza_reader_read_node_start_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void xmpp_stanza_reader_read_text_node_data_free (gpointer _data);
static gboolean xmpp_stanza_reader_read_text_node_co (XmppStanzaReaderReadTextNodeData* _data_);
static void xmpp_stanza_reader_read_text_node_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void xmpp_stanza_reader_read_root_node_data_free (gpointer _data);
static gboolean xmpp_stanza_reader_read_root_node_co (XmppStanzaReaderReadRootNodeData* _data_);
static void xmpp_stanza_reader_read_root_node_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void xmpp_stanza_reader_read_stanza_node_data_free (gpointer _data);
static gboolean xmpp_stanza_reader_read_stanza_node_co (XmppStanzaReaderReadStanzaNodeData* _data_);
static void xmpp_stanza_reader_read_stanza_node_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void xmpp_stanza_reader_read_node_data_free (gpointer _data);
static gboolean xmpp_stanza_reader_read_node_co (XmppStanzaReaderReadNodeData* _data_);
static void xmpp_stanza_reader_read_node_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void xmpp_stanza_reader_finalize (XmppStanzaReader * obj);
static GType xmpp_stanza_reader_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_stanza_reader_get_instance_private (XmppStanzaReader* self)
{
	return G_STRUCT_MEMBER_P (self, XmppStanzaReader_private_offset);
}

static guint8*
_vala_array_dup1 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

XmppStanzaReader*
xmpp_stanza_reader_construct_for_buffer (GType object_type,
                                         guint8* buffer,
                                         gint buffer_length1)
{
	XmppStanzaReader* self = NULL;
	guint8* _tmp0_;
	gint _tmp0__length1;
	self = (XmppStanzaReader*) g_type_create_instance (object_type);
	_tmp0_ = (buffer != NULL) ? _vala_array_dup1 (buffer, buffer_length1) : buffer;
	_tmp0__length1 = buffer_length1;
	self->priv->buffer = (g_free (self->priv->buffer), NULL);
	self->priv->buffer = _tmp0_;
	self->priv->buffer_length1 = _tmp0__length1;
	self->priv->_buffer_size_ = self->priv->buffer_length1;
	self->priv->buffer_fill = buffer_length1;
	return self;
}

XmppStanzaReader*
xmpp_stanza_reader_new_for_buffer (guint8* buffer,
                                   gint buffer_length1)
{
	return xmpp_stanza_reader_construct_for_buffer (XMPP_TYPE_STANZA_READER, buffer, buffer_length1);
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

XmppStanzaReader*
xmpp_stanza_reader_construct_for_string (GType object_type,
                                         const gchar* s)
{
	XmppStanzaReader* self = NULL;
	guint8* _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_ = 0;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = string_get_data (s, &_tmp1_);
	_tmp0__length1 = _tmp1_;
	_tmp2_ = _tmp0_;
	_tmp2__length1 = _tmp0__length1;
	self = (XmppStanzaReader*) xmpp_stanza_reader_construct_for_buffer (object_type, _tmp2_, (gint) _tmp2__length1);
	return self;
}

XmppStanzaReader*
xmpp_stanza_reader_new_for_string (const gchar* s)
{
	return xmpp_stanza_reader_construct_for_string (XMPP_TYPE_STANZA_READER, s);
}

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

XmppStanzaReader*
xmpp_stanza_reader_construct_for_stream (GType object_type,
                                         GInputStream* input,
                                         GCancellable* cancellable)
{
	XmppStanzaReader* self = NULL;
	GInputStream* _tmp0_;
	GCancellable* _tmp1_;
	guint8* _tmp2_;
	g_return_val_if_fail (input != NULL, NULL);
	self = (XmppStanzaReader*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (input);
	_g_object_unref0 (self->priv->input);
	self->priv->input = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (self->priv->cancellable);
	self->priv->cancellable = _tmp1_;
	_tmp2_ = g_new0 (guint8, xmpp_stanza_reader_BUFFER_MAX);
	self->priv->buffer = (g_free (self->priv->buffer), NULL);
	self->priv->buffer = _tmp2_;
	self->priv->buffer_length1 = xmpp_stanza_reader_BUFFER_MAX;
	self->priv->_buffer_size_ = self->priv->buffer_length1;
	return self;
}

XmppStanzaReader*
xmpp_stanza_reader_new_for_stream (GInputStream* input,
                                   GCancellable* cancellable)
{
	return xmpp_stanza_reader_construct_for_stream (XMPP_TYPE_STANZA_READER, input, cancellable);
}

static void
xmpp_stanza_reader_update_buffer_data_free (gpointer _data)
{
	XmppStanzaReaderUpdateBufferData* _data_;
	_data_ = _data;
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderUpdateBufferData, _data_);
}

static gpointer
_xmpp_stanza_reader_ref0 (gpointer self)
{
	return self ? xmpp_stanza_reader_ref (self) : NULL;
}

static void
xmpp_stanza_reader_update_buffer (XmppStanzaReader* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	XmppStanzaReaderUpdateBufferData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderUpdateBufferData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_update_buffer_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_update_buffer_co (_data_);
}

static void
xmpp_stanza_reader_update_buffer_finish (XmppStanzaReader* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	XmppStanzaReaderUpdateBufferData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_stanza_reader_update_buffer_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	XmppStanzaReaderUpdateBufferData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_update_buffer_co (_data_);
}

static gboolean
xmpp_stanza_reader_update_buffer_co (XmppStanzaReaderUpdateBufferData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->input;
	_data_->_tmp1_ = _g_object_ref0 (_data_->_tmp0_);
	_data_->input = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->input;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp3_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CLOSED, "No input stream specified and end of buffer reached.");
		_data_->_inner_error0_ = _data_->_tmp3_;
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->input);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->input);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp5_ = _data_->self->priv->cancellable;
	if (_data_->_tmp5_ != NULL) {
		_data_->_tmp6_ = _data_->self->priv->cancellable;
		_data_->_tmp4_ = g_cancellable_is_cancelled (_data_->_tmp6_);
	} else {
		_data_->_tmp4_ = FALSE;
	}
	if (_data_->_tmp4_) {
		_data_->_tmp7_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Input stream is canceled.");
		_data_->_inner_error0_ = _data_->_tmp7_;
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->input);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->input);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	{
		_data_->_tmp9_ = _data_->input;
		_data_->_tmp10_ = _data_->self->priv->buffer;
		_data_->_tmp10__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp11_ = _data_->self->priv->cancellable;
		_data_->_state_ = 1;
		g_input_stream_read_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, g_input_stream_get_type (), GInputStream), _data_->_tmp10_, (gsize) _data_->_tmp10__length1, G_PRIORITY_DEFAULT, _data_->_tmp11_, xmpp_stanza_reader_update_buffer_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp8_ = g_input_stream_read_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, g_input_stream_get_type (), GInputStream), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_TLS_ERROR, G_TLS_ERROR_EOF)) {
				goto __catch0_g_tls_error_eof;
			}
			goto __finally0;
		}
		_data_->self->priv->buffer_fill = (gint) _data_->_tmp8_;
	}
	goto __finally0;
	__catch0_g_tls_error_eof:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_tmp12_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CLOSED, "End of TLS stream reached");
		_data_->_inner_error0_ = _data_->_tmp12_;
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->input);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->input);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->self->priv->buffer_fill == 0) {
		_data_->_tmp13_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CLOSED, "End of input stream reached.");
		_data_->_inner_error0_ = _data_->_tmp13_;
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->input);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->input);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->self->priv->buffer_pos = 0;
	_g_object_unref0 (_data_->input);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_single_data_free (gpointer _data)
{
	XmppStanzaReaderReadSingleData* _data_;
	_data_ = _data;
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadSingleData, _data_);
}

static void
xmpp_stanza_reader_read_single (XmppStanzaReader* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	XmppStanzaReaderReadSingleData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadSingleData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_single_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_single_co (_data_);
}

static gchar
xmpp_stanza_reader_read_single_finish (XmppStanzaReader* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gchar result;
	XmppStanzaReaderReadSingleData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gchar _tmp0_ = '\0';
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
xmpp_stanza_reader_read_single_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	XmppStanzaReaderReadSingleData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_single_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_single_co (XmppStanzaReaderReadSingleData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_single_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	_data_->_tmp0_ = _data_->self->priv->buffer;
	_data_->_tmp0__length1 = _data_->self->priv->buffer_length1;
	_data_->_tmp1_ = _data_->self->priv->buffer_pos;
	_data_->self->priv->buffer_pos = _data_->_tmp1_ + 1;
	_data_->_tmp2_ = _data_->_tmp0_[_data_->_tmp1_];
	_data_->result = (gchar) _data_->_tmp2_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_peek_single_data_free (gpointer _data)
{
	XmppStanzaReaderPeekSingleData* _data_;
	_data_ = _data;
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderPeekSingleData, _data_);
}

static void
xmpp_stanza_reader_peek_single (XmppStanzaReader* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	XmppStanzaReaderPeekSingleData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderPeekSingleData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_peek_single_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_peek_single_co (_data_);
}

static gchar
xmpp_stanza_reader_peek_single_finish (XmppStanzaReader* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gchar result;
	XmppStanzaReaderPeekSingleData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gchar _tmp0_ = '\0';
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
xmpp_stanza_reader_peek_single_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	XmppStanzaReaderPeekSingleData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_peek_single_co (_data_);
}

static gboolean
xmpp_stanza_reader_peek_single_co (XmppStanzaReaderPeekSingleData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_peek_single_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	_data_->_tmp0_ = _data_->self->priv->buffer;
	_data_->_tmp0__length1 = _data_->self->priv->buffer_length1;
	_data_->_tmp1_ = _data_->_tmp0_[_data_->self->priv->buffer_pos];
	_data_->result = (gchar) _data_->_tmp1_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
xmpp_stanza_reader_is_ws (XmppStanzaReader* self,
                          guint8 what)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (what == ((guint8) ' ')) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = what == ((guint8) '\t');
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = what == ((guint8) '\r');
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = what == ((guint8) '\n');
	}
	result = _tmp0_;
	return result;
}

static void
xmpp_stanza_reader_skip_single (XmppStanzaReader* self)
{
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->buffer_pos;
	self->priv->buffer_pos = _tmp0_ + 1;
}

static void
xmpp_stanza_reader_skip_until_non_ws_data_free (gpointer _data)
{
	XmppStanzaReaderSkipUntilNonWsData* _data_;
	_data_ = _data;
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderSkipUntilNonWsData, _data_);
}

static void
xmpp_stanza_reader_skip_until_non_ws (XmppStanzaReader* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	XmppStanzaReaderSkipUntilNonWsData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderSkipUntilNonWsData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_skip_until_non_ws_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_skip_until_non_ws_co (_data_);
}

static void
xmpp_stanza_reader_skip_until_non_ws_finish (XmppStanzaReader* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	XmppStanzaReaderSkipUntilNonWsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_stanza_reader_skip_until_non_ws_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	XmppStanzaReaderSkipUntilNonWsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_skip_until_non_ws_co (_data_);
}

static gboolean
xmpp_stanza_reader_skip_until_non_ws_co (XmppStanzaReaderSkipUntilNonWsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_skip_until_non_ws_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	while (TRUE) {
		_data_->_tmp0_ = _data_->self->priv->buffer;
		_data_->_tmp0__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp1_ = _data_->_tmp0_[_data_->self->priv->buffer_pos];
		if (!xmpp_stanza_reader_is_ws (_data_->self, _data_->_tmp1_)) {
			break;
		}
		_data_->_tmp2_ = _data_->self->priv->buffer_pos;
		_data_->self->priv->buffer_pos = _data_->_tmp2_ + 1;
		if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
			_data_->_state_ = 2;
			xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_skip_until_non_ws_ready, _data_);
			return FALSE;
			_state_2:
			xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_until_ws_data_free (gpointer _data)
{
	XmppStanzaReaderReadUntilWsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadUntilWsData, _data_);
}

static void
xmpp_stanza_reader_read_until_ws (XmppStanzaReader* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	XmppStanzaReaderReadUntilWsData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadUntilWsData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_until_ws_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_until_ws_co (_data_);
}

static gchar*
xmpp_stanza_reader_read_until_ws_finish (XmppStanzaReader* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	gchar* result;
	XmppStanzaReaderReadUntilWsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_until_ws_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	XmppStanzaReaderReadUntilWsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_until_ws_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_until_ws_co (XmppStanzaReaderReadUntilWsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_string_new ("");
	_data_->res = _data_->_tmp0_;
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_ws_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_string_free0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_string_free0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	while (TRUE) {
		_data_->_tmp1_ = _data_->self->priv->buffer;
		_data_->_tmp1__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp2_ = _data_->_tmp1_[_data_->self->priv->buffer_pos];
		if (!(!xmpp_stanza_reader_is_ws (_data_->self, _data_->_tmp2_))) {
			break;
		}
		_data_->_tmp3_ = _data_->res;
		_data_->_tmp4_ = _data_->self->priv->buffer;
		_data_->_tmp4__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp5_ = _data_->self->priv->buffer_pos;
		_data_->self->priv->buffer_pos = _data_->_tmp5_ + 1;
		_data_->_tmp6_ = _data_->_tmp4_[_data_->_tmp5_];
		g_string_append_c (_data_->_tmp3_, (gchar) _data_->_tmp6_);
		if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
			_data_->_state_ = 2;
			xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_ws_ready, _data_);
			return FALSE;
			_state_2:
			xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_string_free0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_string_free0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	_data_->_tmp7_ = _data_->res;
	_data_->_tmp8_ = _data_->_tmp7_->str;
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	_g_string_free0 (_data_->res);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_until_char_or_ws_data_free (gpointer _data)
{
	XmppStanzaReaderReadUntilCharOrWsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadUntilCharOrWsData, _data_);
}

static void
xmpp_stanza_reader_read_until_char_or_ws (XmppStanzaReader* self,
                                          gchar x,
                                          gchar y,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	XmppStanzaReaderReadUntilCharOrWsData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadUntilCharOrWsData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_until_char_or_ws_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	_data_->x = x;
	_data_->y = y;
	xmpp_stanza_reader_read_until_char_or_ws_co (_data_);
}

static gchar*
xmpp_stanza_reader_read_until_char_or_ws_finish (XmppStanzaReader* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	gchar* result;
	XmppStanzaReaderReadUntilCharOrWsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_until_char_or_ws_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	XmppStanzaReaderReadUntilCharOrWsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_until_char_or_ws_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_until_char_or_ws_co (XmppStanzaReaderReadUntilCharOrWsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_string_new ("");
	_data_->res = _data_->_tmp0_;
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_char_or_ws_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_string_free0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_string_free0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	while (TRUE) {
		_data_->_tmp3_ = _data_->self->priv->buffer;
		_data_->_tmp3__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp4_ = _data_->_tmp3_[_data_->self->priv->buffer_pos];
		if (_data_->_tmp4_ != ((guint8) _data_->x)) {
			_data_->_tmp5_ = _data_->self->priv->buffer;
			_data_->_tmp5__length1 = _data_->self->priv->buffer_length1;
			_data_->_tmp6_ = _data_->_tmp5_[_data_->self->priv->buffer_pos];
			_data_->_tmp2_ = _data_->_tmp6_ != ((guint8) _data_->y);
		} else {
			_data_->_tmp2_ = FALSE;
		}
		if (_data_->_tmp2_) {
			_data_->_tmp7_ = _data_->self->priv->buffer;
			_data_->_tmp7__length1 = _data_->self->priv->buffer_length1;
			_data_->_tmp8_ = _data_->_tmp7_[_data_->self->priv->buffer_pos];
			_data_->_tmp1_ = !xmpp_stanza_reader_is_ws (_data_->self, _data_->_tmp8_);
		} else {
			_data_->_tmp1_ = FALSE;
		}
		if (!_data_->_tmp1_) {
			break;
		}
		_data_->_tmp9_ = _data_->res;
		_data_->_tmp10_ = _data_->self->priv->buffer;
		_data_->_tmp10__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp11_ = _data_->self->priv->buffer_pos;
		_data_->self->priv->buffer_pos = _data_->_tmp11_ + 1;
		_data_->_tmp12_ = _data_->_tmp10_[_data_->_tmp11_];
		g_string_append_c (_data_->_tmp9_, (gchar) _data_->_tmp12_);
		if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
			_data_->_state_ = 2;
			xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_char_or_ws_ready, _data_);
			return FALSE;
			_state_2:
			xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_string_free0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_string_free0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	_data_->_tmp13_ = _data_->res;
	_data_->_tmp14_ = _data_->_tmp13_->str;
	_data_->_tmp15_ = g_strdup (_data_->_tmp14_);
	_data_->result = _data_->_tmp15_;
	_g_string_free0 (_data_->res);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_until_char_data_free (gpointer _data)
{
	XmppStanzaReaderReadUntilCharData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadUntilCharData, _data_);
}

static void
xmpp_stanza_reader_read_until_char (XmppStanzaReader* self,
                                    gchar x,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	XmppStanzaReaderReadUntilCharData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadUntilCharData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_until_char_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	_data_->x = x;
	xmpp_stanza_reader_read_until_char_co (_data_);
}

static gchar*
xmpp_stanza_reader_read_until_char_finish (XmppStanzaReader* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	gchar* result;
	XmppStanzaReaderReadUntilCharData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_until_char_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	XmppStanzaReaderReadUntilCharData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_until_char_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_until_char_co (XmppStanzaReaderReadUntilCharData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_string_new ("");
	_data_->res = _data_->_tmp0_;
	if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
		_data_->_state_ = 1;
		xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_char_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_string_free0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_string_free0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	while (TRUE) {
		_data_->_tmp1_ = _data_->self->priv->buffer;
		_data_->_tmp1__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp2_ = _data_->_tmp1_[_data_->self->priv->buffer_pos];
		if (!(_data_->_tmp2_ != ((guint8) _data_->x))) {
			break;
		}
		_data_->_tmp3_ = _data_->res;
		_data_->_tmp4_ = _data_->self->priv->buffer;
		_data_->_tmp4__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp5_ = _data_->self->priv->buffer_pos;
		_data_->self->priv->buffer_pos = _data_->_tmp5_ + 1;
		_data_->_tmp6_ = _data_->_tmp4_[_data_->_tmp5_];
		g_string_append_c (_data_->_tmp3_, (gchar) _data_->_tmp6_);
		if (_data_->self->priv->buffer_pos >= _data_->self->priv->buffer_fill) {
			_data_->_state_ = 2;
			xmpp_stanza_reader_update_buffer (_data_->self, xmpp_stanza_reader_read_until_char_ready, _data_);
			return FALSE;
			_state_2:
			xmpp_stanza_reader_update_buffer_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_string_free0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_string_free0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	_data_->_tmp7_ = _data_->res;
	_data_->_tmp8_ = _data_->_tmp7_->str;
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	_g_string_free0 (_data_->res);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_attribute_data_free (gpointer _data)
{
	XmppStanzaReaderReadAttributeData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadAttributeData, _data_);
}

static void
xmpp_stanza_reader_read_attribute (XmppStanzaReader* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	XmppStanzaReaderReadAttributeData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadAttributeData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_attribute_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_attribute_co (_data_);
}

static XmppStanzaAttribute*
xmpp_stanza_reader_read_attribute_finish (XmppStanzaReader* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	XmppStanzaAttribute* result;
	XmppStanzaReaderReadAttributeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_attribute_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	XmppStanzaReaderReadAttributeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_attribute_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_attribute_co (XmppStanzaReaderReadAttributeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_attribute_new ();
	_data_->res = _data_->_tmp0_;
	_data_->_state_ = 1;
	xmpp_stanza_reader_read_until_char_or_ws (_data_->self, '=', (gchar) 0, xmpp_stanza_reader_read_attribute_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = xmpp_stanza_reader_read_until_char_or_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp1_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp3_ = _data_->res;
	_data_->_tmp4_ = _data_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_g_free0 (((XmppStanzaEntry*) _data_->_tmp3_)->name);
	((XmppStanzaEntry*) _data_->_tmp3_)->name = _data_->_tmp4_;
	_data_->_state_ = 2;
	xmpp_stanza_reader_read_single (_data_->self, xmpp_stanza_reader_read_attribute_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp5_ = xmpp_stanza_reader_read_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_tmp1_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_tmp1_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp5_ == '=') {
		_data_->_state_ = 3;
		xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_attribute_ready, _data_);
		return FALSE;
		_state_3:
		_data_->quot = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->_tmp1_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_free0 (_data_->_tmp1_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		if (_data_->quot == '\'') {
			_data_->_tmp6_ = TRUE;
		} else {
			_data_->_tmp6_ = _data_->quot == '"';
		}
		if (_data_->_tmp6_) {
			xmpp_stanza_reader_skip_single (_data_->self);
			_data_->_state_ = 4;
			xmpp_stanza_reader_read_until_char (_data_->self, _data_->quot, xmpp_stanza_reader_read_attribute_ready, _data_);
			return FALSE;
			_state_4:
			_data_->_tmp8_ = xmpp_stanza_reader_read_until_char_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp7_ = _data_->_tmp8_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_free0 (_data_->_tmp1_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_free0 (_data_->_tmp1_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			_data_->_tmp9_ = _data_->res;
			xmpp_stanza_entry_set_encoded_val ((XmppStanzaEntry*) _data_->_tmp9_, _data_->_tmp7_);
			xmpp_stanza_reader_skip_single (_data_->self);
			_g_free0 (_data_->_tmp7_);
		} else {
			_data_->_state_ = 5;
			xmpp_stanza_reader_read_until_ws (_data_->self, xmpp_stanza_reader_read_attribute_ready, _data_);
			return FALSE;
			_state_5:
			_data_->_tmp11_ = xmpp_stanza_reader_read_until_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp10_ = _data_->_tmp11_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_free0 (_data_->_tmp1_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_free0 (_data_->_tmp1_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			_data_->_tmp12_ = _data_->res;
			xmpp_stanza_entry_set_encoded_val ((XmppStanzaEntry*) _data_->_tmp12_, _data_->_tmp10_);
			_g_free0 (_data_->_tmp10_);
		}
	}
	_data_->result = _data_->res;
	_g_free0 (_data_->_tmp1_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
xmpp_stanza_reader_handle_entry_ns (XmppStanzaReader* self,
                                    XmppStanzaEntry* entry,
                                    const gchar* default_uri,
                                    GError** error)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entry != NULL);
	g_return_if_fail (default_uri != NULL);
	_tmp0_ = entry->ns_uri;
	if (_tmp0_ != NULL) {
		return;
	}
	_tmp1_ = entry->name;
	if (string_contains (_tmp1_, ":")) {
		gchar** split = NULL;
		const gchar* _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_;
		gint split_length1;
		gint _split_size_;
		gchar* _tmp5_ = NULL;
		XmppNamespaceState* _tmp6_;
		gchar** _tmp7_;
		gint _tmp7__length1;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar** _tmp11_;
		gint _tmp11__length1;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp2_ = entry->name;
		_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 0);
		split = _tmp4_;
		split_length1 = _vala_array_length (_tmp3_);
		_split_size_ = split_length1;
		_tmp6_ = self->priv->ns_state;
		_tmp7_ = split;
		_tmp7__length1 = split_length1;
		_tmp8_ = _tmp7_[0];
		_tmp9_ = xmpp_namespace_state_find_uri (_tmp6_, _tmp8_, &_inner_error0_);
		_tmp5_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				g_propagate_error (error, _inner_error0_);
				split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
				return;
			} else {
				split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		_tmp10_ = _tmp5_;
		_tmp5_ = NULL;
		_g_free0 (entry->ns_uri);
		entry->ns_uri = _tmp10_;
		_tmp11_ = split;
		_tmp11__length1 = split_length1;
		_tmp12_ = _tmp11_[1];
		_tmp13_ = g_strdup (_tmp12_);
		_g_free0 (entry->name);
		entry->name = _tmp13_;
		_g_free0 (_tmp5_);
		split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
	} else {
		gchar* _tmp14_;
		_tmp14_ = g_strdup (default_uri);
		_g_free0 (entry->ns_uri);
		entry->ns_uri = _tmp14_;
	}
}

static void
xmpp_stanza_reader_handle_stanza_ns (XmppStanzaReader* self,
                                     XmppStanzaNode* res,
                                     GError** error)
{
	XmppNamespaceState* _tmp40_;
	const gchar* _tmp41_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (res != NULL);
	{
		GeeList* _attr_list = NULL;
		GeeList* _tmp0_;
		gint _attr_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _attr_index = 0;
		_tmp0_ = res->attributes;
		_attr_list = _tmp0_;
		_tmp1_ = _attr_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_attr_size = _tmp3_;
		_attr_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			XmppStanzaAttribute* attr = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			gboolean _tmp8_ = FALSE;
			XmppStanzaAttribute* _tmp9_;
			const gchar* _tmp10_;
			_attr_index = _attr_index + 1;
			_tmp4_ = _attr_index;
			_tmp5_ = _attr_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _attr_list;
			_tmp7_ = gee_list_get (_tmp6_, _attr_index);
			attr = (XmppStanzaAttribute*) _tmp7_;
			_tmp9_ = attr;
			_tmp10_ = ((XmppStanzaEntry*) _tmp9_)->name;
			if (g_strcmp0 (_tmp10_, "xmlns") == 0) {
				XmppStanzaAttribute* _tmp11_;
				const gchar* _tmp12_;
				_tmp11_ = attr;
				_tmp12_ = ((XmppStanzaEntry*) _tmp11_)->val;
				_tmp8_ = _tmp12_ != NULL;
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				XmppStanzaAttribute* _tmp13_;
				gchar* _tmp14_;
				XmppNamespaceState* _tmp15_;
				XmppStanzaAttribute* _tmp16_;
				const gchar* _tmp17_;
				_tmp13_ = attr;
				_tmp14_ = g_strdup (XMPP_XMLNS_URI);
				_g_free0 (((XmppStanzaEntry*) _tmp13_)->ns_uri);
				((XmppStanzaEntry*) _tmp13_)->ns_uri = _tmp14_;
				_tmp15_ = self->priv->ns_state;
				_tmp16_ = attr;
				_tmp17_ = ((XmppStanzaEntry*) _tmp16_)->val;
				xmpp_namespace_state_set_current (_tmp15_, (const gchar*) _tmp17_);
			} else {
				gboolean _tmp18_ = FALSE;
				XmppStanzaAttribute* _tmp19_;
				const gchar* _tmp20_;
				_tmp19_ = attr;
				_tmp20_ = ((XmppStanzaEntry*) _tmp19_)->name;
				if (string_contains (_tmp20_, ":")) {
					XmppStanzaAttribute* _tmp21_;
					const gchar* _tmp22_;
					_tmp21_ = attr;
					_tmp22_ = ((XmppStanzaEntry*) _tmp21_)->val;
					_tmp18_ = _tmp22_ != NULL;
				} else {
					_tmp18_ = FALSE;
				}
				if (_tmp18_) {
					gchar** split = NULL;
					XmppStanzaAttribute* _tmp23_;
					const gchar* _tmp24_;
					gchar** _tmp25_;
					gchar** _tmp26_;
					gint split_length1;
					gint _split_size_;
					gchar** _tmp27_;
					gint _tmp27__length1;
					const gchar* _tmp28_;
					_tmp23_ = attr;
					_tmp24_ = ((XmppStanzaEntry*) _tmp23_)->name;
					_tmp26_ = _tmp25_ = g_strsplit (_tmp24_, ":", 0);
					split = _tmp26_;
					split_length1 = _vala_array_length (_tmp25_);
					_split_size_ = split_length1;
					_tmp27_ = split;
					_tmp27__length1 = split_length1;
					_tmp28_ = _tmp27_[0];
					if (g_strcmp0 (_tmp28_, "xmlns") == 0) {
						XmppStanzaAttribute* _tmp29_;
						gchar* _tmp30_;
						XmppStanzaAttribute* _tmp31_;
						gchar** _tmp32_;
						gint _tmp32__length1;
						const gchar* _tmp33_;
						gchar* _tmp34_;
						XmppNamespaceState* _tmp35_;
						XmppStanzaAttribute* _tmp36_;
						const gchar* _tmp37_;
						XmppStanzaAttribute* _tmp38_;
						const gchar* _tmp39_;
						_tmp29_ = attr;
						_tmp30_ = g_strdup (XMPP_XMLNS_URI);
						_g_free0 (((XmppStanzaEntry*) _tmp29_)->ns_uri);
						((XmppStanzaEntry*) _tmp29_)->ns_uri = _tmp30_;
						_tmp31_ = attr;
						_tmp32_ = split;
						_tmp32__length1 = split_length1;
						_tmp33_ = _tmp32_[1];
						_tmp34_ = g_strdup (_tmp33_);
						_g_free0 (((XmppStanzaEntry*) _tmp31_)->name);
						((XmppStanzaEntry*) _tmp31_)->name = _tmp34_;
						_tmp35_ = self->priv->ns_state;
						_tmp36_ = attr;
						_tmp37_ = ((XmppStanzaEntry*) _tmp36_)->val;
						_tmp38_ = attr;
						_tmp39_ = ((XmppStanzaEntry*) _tmp38_)->name;
						xmpp_namespace_state_add_assoc (_tmp35_, (const gchar*) _tmp37_, _tmp39_);
					}
					split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
				}
			}
			_xmpp_stanza_entry_unref0 (attr);
		}
	}
	_tmp40_ = self->priv->ns_state;
	_tmp41_ = _tmp40_->current_ns_uri;
	xmpp_stanza_reader_handle_entry_ns (self, (XmppStanzaEntry*) res, _tmp41_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == G_IO_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	{
		GeeList* _attr_list = NULL;
		GeeList* _tmp42_;
		gint _attr_size = 0;
		GeeList* _tmp43_;
		gint _tmp44_;
		gint _tmp45_;
		gint _attr_index = 0;
		_tmp42_ = res->attributes;
		_attr_list = _tmp42_;
		_tmp43_ = _attr_list;
		_tmp44_ = gee_collection_get_size ((GeeCollection*) _tmp43_);
		_tmp45_ = _tmp44_;
		_attr_size = _tmp45_;
		_attr_index = -1;
		while (TRUE) {
			gint _tmp46_;
			gint _tmp47_;
			XmppStanzaAttribute* attr = NULL;
			GeeList* _tmp48_;
			gpointer _tmp49_;
			const gchar* _tmp50_ = NULL;
			const gchar* _tmp51_;
			XmppStanzaAttribute* _tmp54_;
			_attr_index = _attr_index + 1;
			_tmp46_ = _attr_index;
			_tmp47_ = _attr_size;
			if (!(_tmp46_ < _tmp47_)) {
				break;
			}
			_tmp48_ = _attr_list;
			_tmp49_ = gee_list_get (_tmp48_, _attr_index);
			attr = (XmppStanzaAttribute*) _tmp49_;
			_tmp51_ = ((XmppStanzaEntry*) res)->ns_uri;
			_tmp50_ = _tmp51_;
			if (_tmp50_ == NULL) {
				XmppNamespaceState* _tmp52_;
				const gchar* _tmp53_;
				_tmp52_ = self->priv->ns_state;
				_tmp53_ = _tmp52_->current_ns_uri;
				_tmp50_ = _tmp53_;
			}
			_tmp54_ = attr;
			xmpp_stanza_reader_handle_entry_ns (self, (XmppStanzaEntry*) _tmp54_, _tmp50_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == G_IO_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_xmpp_stanza_entry_unref0 (attr);
					return;
				} else {
					_xmpp_stanza_entry_unref0 (attr);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
			_xmpp_stanza_entry_unref0 (attr);
		}
	}
}

static void
xmpp_stanza_reader_read_node_start_data_free (gpointer _data)
{
	XmppStanzaReaderReadNodeStartData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadNodeStartData, _data_);
}

void
xmpp_stanza_reader_read_node_start (XmppStanzaReader* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	XmppStanzaReaderReadNodeStartData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadNodeStartData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_node_start_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_node_start_co (_data_);
}

XmppStanzaNode*
xmpp_stanza_reader_read_node_start_finish (XmppStanzaReader* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	XmppStanzaNode* result;
	XmppStanzaReaderReadNodeStartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_node_start_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	XmppStanzaReaderReadNodeStartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_node_start_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_node_start_co (XmppStanzaReaderReadNodeStartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		case 11:
		goto _state_11;
		case 12:
		goto _state_12;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_node_new ();
	_data_->res = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->res;
	_data_->_tmp2_ = gee_array_list_new (XMPP_TYPE_STANZA_ATTRIBUTE, (GBoxedCopyFunc) xmpp_stanza_entry_ref, (GDestroyNotify) xmpp_stanza_entry_unref, NULL, NULL, NULL);
	_g_object_unref0 (_data_->_tmp1_->attributes);
	_data_->_tmp1_->attributes = (GeeList*) _data_->_tmp2_;
	_data_->eof = FALSE;
	_data_->_state_ = 1;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp3_ == '<') {
		xmpp_stanza_reader_skip_single (_data_->self);
	}
	_data_->_state_ = 2;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp4_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp4_ == '?') {
		_data_->_tmp5_ = _data_->res;
		_data_->_tmp5_->pseudo = TRUE;
	}
	_data_->_state_ = 3;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp6_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp6_ == '/') {
		_data_->eof = TRUE;
		xmpp_stanza_reader_skip_single (_data_->self);
		_data_->_state_ = 4;
		xmpp_stanza_reader_read_until_char_or_ws (_data_->self, '>', (gchar) 0, xmpp_stanza_reader_read_node_start_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp8_ = xmpp_stanza_reader_read_until_char_or_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp7_ = _data_->_tmp8_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp9_ = _data_->res;
		_data_->_tmp10_ = _data_->_tmp7_;
		_data_->_tmp7_ = NULL;
		_g_free0 (((XmppStanzaEntry*) _data_->_tmp9_)->name);
		((XmppStanzaEntry*) _data_->_tmp9_)->name = _data_->_tmp10_;
		while (TRUE) {
			_data_->_state_ = 5;
			xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
			return FALSE;
			_state_5:
			_data_->_tmp11_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_free0 (_data_->_tmp7_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_free0 (_data_->_tmp7_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			if (!(_data_->_tmp11_ != '>')) {
				break;
			}
			xmpp_stanza_reader_skip_single (_data_->self);
		}
		xmpp_stanza_reader_skip_single (_data_->self);
		_data_->_tmp12_ = _data_->res;
		_data_->_tmp12_->has_nodes = FALSE;
		_data_->_tmp13_ = _data_->res;
		_data_->_tmp13_->pseudo = FALSE;
		_data_->_tmp14_ = _data_->res;
		xmpp_stanza_reader_handle_stanza_ns (_data_->self, _data_->_tmp14_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->_tmp7_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_free0 (_data_->_tmp7_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->result = _data_->res;
		_g_free0 (_data_->_tmp7_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 6;
	xmpp_stanza_reader_read_until_char_or_ws (_data_->self, '>', '/', xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_6:
	_data_->_tmp16_ = xmpp_stanza_reader_read_until_char_or_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp15_ = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp17_ = _data_->res;
	_data_->_tmp18_ = _data_->_tmp15_;
	_data_->_tmp15_ = NULL;
	_g_free0 (((XmppStanzaEntry*) _data_->_tmp17_)->name);
	((XmppStanzaEntry*) _data_->_tmp17_)->name = _data_->_tmp18_;
	_data_->_state_ = 7;
	xmpp_stanza_reader_skip_until_non_ws (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_7:
	xmpp_stanza_reader_skip_until_non_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_state_ = 8;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_8:
	_data_->next_char = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	while (TRUE) {
		if (_data_->next_char != '/') {
			_data_->_tmp20_ = _data_->next_char != '>';
		} else {
			_data_->_tmp20_ = FALSE;
		}
		if (_data_->_tmp20_) {
			_data_->_tmp19_ = _data_->next_char != '?';
		} else {
			_data_->_tmp19_ = FALSE;
		}
		if (!_data_->_tmp19_) {
			break;
		}
		_data_->_state_ = 9;
		xmpp_stanza_reader_read_attribute (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
		return FALSE;
		_state_9:
		_data_->_tmp22_ = xmpp_stanza_reader_read_attribute_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp21_ = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp23_ = _data_->res;
		_data_->_tmp24_ = _data_->_tmp23_->attributes;
		gee_collection_add ((GeeCollection*) _data_->_tmp24_, _data_->_tmp21_);
		_data_->_state_ = 10;
		xmpp_stanza_reader_skip_until_non_ws (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
		return FALSE;
		_state_10:
		xmpp_stanza_reader_skip_until_non_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_state_ = 11;
		xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
		return FALSE;
		_state_11:
		_data_->_tmp25_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
				_g_free0 (_data_->_tmp15_);
				_xmpp_stanza_entry_unref0 (_data_->res);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->next_char = _data_->_tmp25_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
	}
	_data_->_state_ = 12;
	xmpp_stanza_reader_read_single (_data_->self, xmpp_stanza_reader_read_node_start_ready, _data_);
	return FALSE;
	_state_12:
	_data_->_tmp27_ = xmpp_stanza_reader_read_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp27_ == '/') {
		_data_->_tmp26_ = TRUE;
	} else {
		_data_->_tmp28_ = _data_->res;
		_data_->_tmp26_ = _data_->_tmp28_->pseudo;
	}
	if (_data_->_tmp26_) {
		_data_->_tmp29_ = _data_->res;
		_data_->_tmp29_->has_nodes = FALSE;
		xmpp_stanza_reader_skip_single (_data_->self);
	} else {
		_data_->_tmp30_ = _data_->res;
		_data_->_tmp30_->has_nodes = TRUE;
	}
	_data_->_tmp31_ = _data_->res;
	xmpp_stanza_reader_handle_stanza_ns (_data_->self, _data_->_tmp31_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_tmp15_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->result = _data_->res;
	_g_free0 (_data_->_tmp15_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_text_node_data_free (gpointer _data)
{
	XmppStanzaReaderReadTextNodeData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadTextNodeData, _data_);
}

void
xmpp_stanza_reader_read_text_node (XmppStanzaReader* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	XmppStanzaReaderReadTextNodeData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadTextNodeData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_text_node_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_text_node_co (_data_);
}

XmppStanzaNode*
xmpp_stanza_reader_read_text_node_finish (XmppStanzaReader* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	XmppStanzaNode* result;
	XmppStanzaReaderReadTextNodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_text_node_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	XmppStanzaReaderReadTextNodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_text_node_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_text_node_co (XmppStanzaReaderReadTextNodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_node_new ();
	_data_->res = _data_->_tmp0_;
	_data_->_tmp1_ = g_strdup ("#text");
	_g_free0 (((XmppStanzaEntry*) _data_->res)->name);
	((XmppStanzaEntry*) _data_->res)->name = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->ns_state;
	_data_->_tmp3_ = _data_->_tmp2_->current_ns_uri;
	_data_->_tmp4_ = g_strdup (_data_->_tmp3_);
	_g_free0 (((XmppStanzaEntry*) _data_->res)->ns_uri);
	((XmppStanzaEntry*) _data_->res)->ns_uri = _data_->_tmp4_;
	_data_->_state_ = 1;
	xmpp_stanza_reader_read_until_char (_data_->self, '<', xmpp_stanza_reader_read_text_node_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = xmpp_stanza_reader_read_until_char_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp6_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	xmpp_stanza_entry_set_encoded_val ((XmppStanzaEntry*) _data_->res, _data_->_tmp5_);
	_data_->result = _data_->res;
	_g_free0 (_data_->_tmp5_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_stanza_reader_read_root_node_data_free (gpointer _data)
{
	XmppStanzaReaderReadRootNodeData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadRootNodeData, _data_);
}

void
xmpp_stanza_reader_read_root_node (XmppStanzaReader* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	XmppStanzaReaderReadRootNodeData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadRootNodeData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_root_node_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_root_node_co (_data_);
}

XmppStanzaNode*
xmpp_stanza_reader_read_root_node_finish (XmppStanzaReader* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	XmppStanzaNode* result;
	XmppStanzaReaderReadRootNodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_root_node_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	XmppStanzaReaderReadRootNodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_root_node_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_root_node_co (XmppStanzaReaderReadRootNodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_stanza_reader_skip_until_non_ws (_data_->self, xmpp_stanza_reader_read_root_node_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_stanza_reader_skip_until_non_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_state_ = 2;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_root_node_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp0_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp0_ == '<') {
		_data_->_state_ = 3;
		xmpp_stanza_reader_read_node_start (_data_->self, xmpp_stanza_reader_read_root_node_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp1_ = xmpp_stanza_reader_read_node_start_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->res = _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp2_ = _data_->res;
		if (_data_->_tmp2_->pseudo) {
			_data_->_state_ = 4;
			xmpp_stanza_reader_read_root_node (_data_->self, xmpp_stanza_reader_read_root_node_ready, _data_);
			return FALSE;
			_state_4:
			_data_->_tmp4_ = xmpp_stanza_reader_read_root_node_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp3_ = _data_->_tmp4_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_xmpp_stanza_entry_unref0 (_data_->res);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			_data_->_tmp5_ = _data_->_tmp3_;
			_data_->_tmp3_ = NULL;
			_data_->result = _data_->_tmp5_;
			_xmpp_stanza_entry_unref0 (_data_->_tmp3_);
			_xmpp_stanza_entry_unref0 (_data_->res);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->result = _data_->res;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		_data_->_tmp6_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "XML: Content before root node");
		_data_->_inner_error0_ = _data_->_tmp6_;
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
}

static void
xmpp_stanza_reader_read_stanza_node_data_free (gpointer _data)
{
	XmppStanzaReaderReadStanzaNodeData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadStanzaNodeData, _data_);
}

void
xmpp_stanza_reader_read_stanza_node (XmppStanzaReader* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	XmppStanzaReaderReadStanzaNodeData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadStanzaNodeData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_stanza_node_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_stanza_node_co (_data_);
}

XmppStanzaNode*
xmpp_stanza_reader_read_stanza_node_finish (XmppStanzaReader* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	XmppStanzaNode* result;
	XmppStanzaReaderReadStanzaNodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_stanza_node_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	XmppStanzaReaderReadStanzaNodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_stanza_node_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
xmpp_stanza_reader_read_stanza_node_co (XmppStanzaReaderReadStanzaNodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->ns_state;
		_data_->_tmp1_ = xmpp_namespace_state_push (_data_->_tmp0_);
		_xmpp_namespace_state_unref0 (_data_->self->priv->ns_state);
		_data_->self->priv->ns_state = _data_->_tmp1_;
		_data_->_state_ = 1;
		xmpp_stanza_reader_read_node_start (_data_->self, xmpp_stanza_reader_read_stanza_node_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = xmpp_stanza_reader_read_node_start_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->res = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
				goto __catch0_g_io_error_invalid_data;
			}
			goto __finally0;
		}
		_data_->_tmp3_ = _data_->res;
		if (_data_->_tmp3_->has_nodes) {
			_data_->finish_node_seen = FALSE;
			_data_->text_node = NULL;
			{
				_data_->_tmp4_ = TRUE;
				while (TRUE) {
					if (!_data_->_tmp4_) {
						if (!(!_data_->finish_node_seen)) {
							break;
						}
					}
					_data_->_tmp4_ = FALSE;
					_data_->_state_ = 2;
					xmpp_stanza_reader_read_text_node (_data_->self, xmpp_stanza_reader_read_stanza_node_ready, _data_);
					return FALSE;
					_state_2:
					_data_->_tmp6_ = xmpp_stanza_reader_read_text_node_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp5_ = _data_->_tmp6_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_xmpp_stanza_entry_unref0 (_data_->text_node);
						_xmpp_stanza_entry_unref0 (_data_->res);
						if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
							goto __catch0_g_io_error_invalid_data;
						}
						goto __finally0;
					}
					_data_->_tmp7_ = _data_->_tmp5_;
					_data_->_tmp5_ = NULL;
					_xmpp_stanza_entry_unref0 (_data_->text_node);
					_data_->text_node = _data_->_tmp7_;
					_data_->_state_ = 3;
					xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_stanza_node_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp8_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
						_xmpp_stanza_entry_unref0 (_data_->text_node);
						_xmpp_stanza_entry_unref0 (_data_->res);
						if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
							goto __catch0_g_io_error_invalid_data;
						}
						goto __finally0;
					}
					if (_data_->_tmp8_ == '<') {
						xmpp_stanza_reader_skip_single (_data_->self);
						_data_->_state_ = 4;
						xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_stanza_node_ready, _data_);
						return FALSE;
						_state_4:
						_data_->_tmp9_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
							_xmpp_stanza_entry_unref0 (_data_->text_node);
							_xmpp_stanza_entry_unref0 (_data_->res);
							if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
								goto __catch0_g_io_error_invalid_data;
							}
							goto __finally0;
						}
						if (_data_->_tmp9_ == '/') {
							xmpp_stanza_reader_skip_single (_data_->self);
							_data_->_state_ = 5;
							xmpp_stanza_reader_read_until_char (_data_->self, '>', xmpp_stanza_reader_read_stanza_node_ready, _data_);
							return FALSE;
							_state_5:
							_data_->_tmp10_ = xmpp_stanza_reader_read_until_char_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
							_data_->desc = _data_->_tmp10_;
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
								_xmpp_stanza_entry_unref0 (_data_->text_node);
								_xmpp_stanza_entry_unref0 (_data_->res);
								if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
									goto __catch0_g_io_error_invalid_data;
								}
								goto __finally0;
							}
							xmpp_stanza_reader_skip_single (_data_->self);
							_data_->_tmp11_ = _data_->desc;
							if (string_contains (_data_->_tmp11_, ":")) {
								_data_->_tmp12_ = _data_->desc;
								_data_->_tmp14_ = _data_->_tmp13_ = g_strsplit (_data_->_tmp12_, ":", 0);
								_data_->split = _data_->_tmp14_;
								_data_->split_length1 = _vala_array_length (_data_->_tmp13_);
								_data_->_split_size_ = _data_->split_length1;
								_data_->_tmp16_ = _data_->self->priv->ns_state;
								_data_->_tmp17_ = _data_->res;
								_data_->_tmp18_ = ((XmppStanzaEntry*) _data_->_tmp17_)->ns_uri;
								_data_->_tmp19_ = xmpp_namespace_state_find_name (_data_->_tmp16_, (const gchar*) _data_->_tmp18_, &_data_->_inner_error0_);
								_data_->_tmp15_ = _data_->_tmp19_;
								if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
									_data_->split = (_vala_array_free (_data_->split, _data_->split_length1, (GDestroyNotify) g_free), NULL);
									_g_free0 (_data_->desc);
									_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
									_xmpp_stanza_entry_unref0 (_data_->text_node);
									_xmpp_stanza_entry_unref0 (_data_->res);
									if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
										goto __catch0_g_io_error_invalid_data;
									}
									goto __finally0;
								}
								_data_->_tmp20_ = _data_->split;
								_data_->_tmp20__length1 = _data_->split_length1;
								_data_->_tmp21_ = _data_->_tmp20_[0];
								if (g_strcmp0 (_data_->_tmp21_, _data_->_tmp15_) != 0) {
									_data_->_tmp22_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "XML: Closing namespace prefix mismatch");
									_data_->_inner_error0_ = _data_->_tmp22_;
									_g_free0 (_data_->_tmp15_);
									_data_->split = (_vala_array_free (_data_->split, _data_->split_length1, (GDestroyNotify) g_free), NULL);
									_g_free0 (_data_->desc);
									_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
									_xmpp_stanza_entry_unref0 (_data_->text_node);
									_xmpp_stanza_entry_unref0 (_data_->res);
									if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
										goto __catch0_g_io_error_invalid_data;
									}
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
									g_clear_error (&_data_->_inner_error0_);
									g_object_unref (_data_->_async_result);
									return FALSE;
								}
								_data_->_tmp23_ = _data_->split;
								_data_->_tmp23__length1 = _data_->split_length1;
								_data_->_tmp24_ = _data_->_tmp23_[1];
								_data_->_tmp25_ = _data_->res;
								_data_->_tmp26_ = ((XmppStanzaEntry*) _data_->_tmp25_)->name;
								if (g_strcmp0 (_data_->_tmp24_, _data_->_tmp26_) != 0) {
									_data_->_tmp27_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "XML: Closing element name mismatch");
									_data_->_inner_error0_ = _data_->_tmp27_;
									_g_free0 (_data_->_tmp15_);
									_data_->split = (_vala_array_free (_data_->split, _data_->split_length1, (GDestroyNotify) g_free), NULL);
									_g_free0 (_data_->desc);
									_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
									_xmpp_stanza_entry_unref0 (_data_->text_node);
									_xmpp_stanza_entry_unref0 (_data_->res);
									if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
										goto __catch0_g_io_error_invalid_data;
									}
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
									g_clear_error (&_data_->_inner_error0_);
									g_object_unref (_data_->_async_result);
									return FALSE;
								}
								_g_free0 (_data_->_tmp15_);
								_data_->split = (_vala_array_free (_data_->split, _data_->split_length1, (GDestroyNotify) g_free), NULL);
							} else {
								_data_->_tmp28_ = _data_->self->priv->ns_state;
								_data_->_tmp29_ = _data_->_tmp28_->current_ns_uri;
								_data_->_tmp30_ = _data_->res;
								_data_->_tmp31_ = ((XmppStanzaEntry*) _data_->_tmp30_)->ns_uri;
								if (g_strcmp0 (_data_->_tmp29_, _data_->_tmp31_) != 0) {
									_data_->_tmp32_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "XML: Closing element namespace mismatch");
									_data_->_inner_error0_ = _data_->_tmp32_;
									_g_free0 (_data_->desc);
									_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
									_xmpp_stanza_entry_unref0 (_data_->text_node);
									_xmpp_stanza_entry_unref0 (_data_->res);
									if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
										goto __catch0_g_io_error_invalid_data;
									}
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
									g_clear_error (&_data_->_inner_error0_);
									g_object_unref (_data_->_async_result);
									return FALSE;
								}
								_data_->_tmp33_ = _data_->desc;
								_data_->_tmp34_ = _data_->res;
								_data_->_tmp35_ = ((XmppStanzaEntry*) _data_->_tmp34_)->name;
								if (g_strcmp0 (_data_->_tmp33_, _data_->_tmp35_) != 0) {
									_data_->_tmp36_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "XML: Closing element name mismatch");
									_data_->_inner_error0_ = _data_->_tmp36_;
									_g_free0 (_data_->desc);
									_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
									_xmpp_stanza_entry_unref0 (_data_->text_node);
									_xmpp_stanza_entry_unref0 (_data_->res);
									if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
										goto __catch0_g_io_error_invalid_data;
									}
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
									g_clear_error (&_data_->_inner_error0_);
									g_object_unref (_data_->_async_result);
									return FALSE;
								}
							}
							_data_->finish_node_seen = TRUE;
							_g_free0 (_data_->desc);
						} else {
							_data_->_state_ = 6;
							xmpp_stanza_reader_read_stanza_node (_data_->self, xmpp_stanza_reader_read_stanza_node_ready, _data_);
							return FALSE;
							_state_6:
							_data_->_tmp38_ = xmpp_stanza_reader_read_stanza_node_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
							_data_->_tmp37_ = _data_->_tmp38_;
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
								_xmpp_stanza_entry_unref0 (_data_->text_node);
								_xmpp_stanza_entry_unref0 (_data_->res);
								if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
									goto __catch0_g_io_error_invalid_data;
								}
								goto __finally0;
							}
							_data_->_tmp39_ = _data_->res;
							_data_->_tmp40_ = _data_->_tmp39_->sub_nodes;
							gee_collection_add ((GeeCollection*) _data_->_tmp40_, _data_->_tmp37_);
							_xmpp_stanza_entry_unref0 (_data_->_tmp37_);
						}
					}
					_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
				}
			}
			_data_->_tmp41_ = _data_->res;
			_data_->_tmp42_ = _data_->_tmp41_->sub_nodes;
			_data_->_tmp43_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp42_);
			_data_->_tmp44_ = _data_->_tmp43_;
			if (_data_->_tmp44_ == 0) {
				_data_->_tmp46_ = _data_->text_node;
				if (_data_->_tmp46_ == NULL) {
					_data_->_tmp45_ = TRUE;
				} else {
					_data_->_tmp47_ = _data_->text_node;
					_data_->_tmp48_ = ((XmppStanzaEntry*) _data_->_tmp47_)->val;
					_data_->_tmp49_ = strlen (_data_->_tmp48_);
					_data_->_tmp50_ = _data_->_tmp49_;
					_data_->_tmp45_ = _data_->_tmp50_ == 0;
				}
				if (_data_->_tmp45_) {
					_data_->_tmp51_ = _data_->res;
					_data_->_tmp51_->has_nodes = FALSE;
				} else {
					_data_->_tmp52_ = _data_->res;
					_data_->_tmp53_ = _data_->_tmp52_->sub_nodes;
					_data_->_tmp54_ = _data_->text_node;
					gee_collection_add ((GeeCollection*) _data_->_tmp53_, _data_->_tmp54_);
				}
			}
			_xmpp_stanza_entry_unref0 (_data_->text_node);
		}
		_data_->_tmp55_ = _data_->self->priv->ns_state;
		_data_->_tmp56_ = xmpp_namespace_state_pop (_data_->_tmp55_);
		_xmpp_namespace_state_unref0 (_data_->self->priv->ns_state);
		_data_->self->priv->ns_state = _data_->_tmp56_;
		_data_->result = _data_->res;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally0;
	__catch0_g_io_error_invalid_data:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp57_ = _data_->self->priv->buffer;
		_data_->_tmp57__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp58_ = g_new0 (guint8, _data_->_tmp57__length1 + 1);
		_data_->buffer_cpy = _data_->_tmp58_;
		_data_->buffer_cpy_length1 = _data_->_tmp57__length1 + 1;
		_data_->_buffer_cpy_size_ = _data_->buffer_cpy_length1;
		_data_->_tmp59_ = _data_->buffer_cpy;
		_data_->_tmp59__length1 = _data_->buffer_cpy_length1;
		_data_->_tmp60_ = _data_->self->priv->buffer;
		_data_->_tmp60__length1 = _data_->self->priv->buffer_length1;
		_data_->_tmp61_ = _data_->self->priv->buffer;
		_data_->_tmp61__length1 = _data_->self->priv->buffer_length1;
		memcpy (_data_->_tmp59_, _data_->_tmp60_, (gsize) _data_->_tmp61__length1);
		_data_->_tmp62_ = _data_->buffer_cpy;
		_data_->_tmp62__length1 = _data_->buffer_cpy_length1;
		_data_->_tmp63_ = g_strdup_printf ("invalid data at: %s", (const gchar*) _data_->_tmp62_);
		_data_->_tmp64_ = _data_->_tmp63_;
		_data_->_tmp65_ = g_strconcat (_data_->_tmp64_, "\n", NULL);
		_data_->_tmp66_ = _data_->_tmp65_;
		g_warning ("stanza_reader.vala:271: %s", _data_->_tmp66_);
		_g_free0 (_data_->_tmp66_);
		_g_free0 (_data_->_tmp64_);
		_data_->_tmp67_ = _data_->e;
		_data_->_tmp68_ = _g_error_copy0 (_data_->_tmp67_);
		_data_->_inner_error0_ = _data_->_tmp68_;
		_data_->buffer_cpy = (g_free (_data_->buffer_cpy), NULL);
		_g_error_free0 (_data_->e);
		goto __finally0;
	}
	__finally0:
	if (_data_->_inner_error0_->domain == G_IO_ERROR) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
}

static void
xmpp_stanza_reader_read_node_data_free (gpointer _data)
{
	XmppStanzaReaderReadNodeData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->result);
	_xmpp_stanza_reader_unref0 (_data_->self);
	g_slice_free (XmppStanzaReaderReadNodeData, _data_);
}

void
xmpp_stanza_reader_read_node (XmppStanzaReader* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	XmppStanzaReaderReadNodeData* _data_;
	XmppStanzaReader* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppStanzaReaderReadNodeData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_stanza_reader_read_node_data_free);
	_tmp0_ = _xmpp_stanza_reader_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_stanza_reader_read_node_co (_data_);
}

XmppStanzaNode*
xmpp_stanza_reader_read_node_finish (XmppStanzaReader* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	XmppStanzaNode* result;
	XmppStanzaReaderReadNodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_stanza_reader_read_node_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	XmppStanzaReaderReadNodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_stanza_reader_read_node_co (_data_);
}

static gboolean
xmpp_stanza_reader_read_node_co (XmppStanzaReaderReadNodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_stanza_reader_skip_until_non_ws (_data_->self, xmpp_stanza_reader_read_node_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_stanza_reader_skip_until_non_ws_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_state_ = 2;
	xmpp_stanza_reader_peek_single (_data_->self, xmpp_stanza_reader_read_node_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp0_ = xmpp_stanza_reader_peek_single_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_tmp0_ == '<') {
		_data_->_state_ = 3;
		xmpp_stanza_reader_read_stanza_node (_data_->self, xmpp_stanza_reader_read_node_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp2_ = xmpp_stanza_reader_read_stanza_node_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp1_ = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp3_ = _data_->_tmp1_;
		_data_->_tmp1_ = NULL;
		_data_->result = _data_->_tmp3_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		_data_->_state_ = 4;
		xmpp_stanza_reader_read_text_node (_data_->self, xmpp_stanza_reader_read_node_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp5_ = xmpp_stanza_reader_read_text_node_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp4_ = _data_->_tmp5_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp6_ = _data_->_tmp4_;
		_data_->_tmp4_ = NULL;
		_data_->result = _data_->_tmp6_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp4_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
}

XmppStanzaReader*
xmpp_stanza_reader_construct (GType object_type)
{
	XmppStanzaReader* self = NULL;
	self = (XmppStanzaReader*) g_type_create_instance (object_type);
	return self;
}

XmppStanzaReader*
xmpp_stanza_reader_new (void)
{
	return xmpp_stanza_reader_construct (XMPP_TYPE_STANZA_READER);
}

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

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

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

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

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

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

GParamSpec*
xmpp_param_spec_stanza_reader (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags)
{
	XmppParamSpecStanzaReader* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_TYPE_STANZA_READER), 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);
}

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

void
xmpp_value_set_stanza_reader (GValue* value,
                              gpointer v_object)
{
	XmppStanzaReader * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_TYPE_STANZA_READER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_TYPE_STANZA_READER));
		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;
		xmpp_stanza_reader_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_stanza_reader_unref (old);
	}
}

void
xmpp_value_take_stanza_reader (GValue* value,
                               gpointer v_object)
{
	XmppStanzaReader * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_TYPE_STANZA_READER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_TYPE_STANZA_READER));
		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) {
		xmpp_stanza_reader_unref (old);
	}
}

static void
xmpp_stanza_reader_class_init (XmppStanzaReaderClass * klass,
                               gpointer klass_data)
{
	xmpp_stanza_reader_parent_class = g_type_class_peek_parent (klass);
	((XmppStanzaReaderClass *) klass)->finalize = xmpp_stanza_reader_finalize;
	g_type_class_adjust_private_offset (klass, &XmppStanzaReader_private_offset);
}

static void
xmpp_stanza_reader_instance_init (XmppStanzaReader * self,
                                  gpointer klass)
{
	XmppNamespaceState* _tmp0_;
	self->priv = xmpp_stanza_reader_get_instance_private (self);
	self->priv->buffer_fill = 0;
	self->priv->buffer_pos = 0;
	_tmp0_ = xmpp_namespace_state_new ();
	self->priv->ns_state = _tmp0_;
	self->ref_count = 1;
}

static void
xmpp_stanza_reader_finalize (XmppStanzaReader * obj)
{
	XmppStanzaReader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_TYPE_STANZA_READER, XmppStanzaReader);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->input);
	self->priv->buffer = (g_free (self->priv->buffer), NULL);
	_g_object_unref0 (self->priv->cancellable);
	_xmpp_namespace_state_unref0 (self->priv->ns_state);
}

static GType
xmpp_stanza_reader_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_value_stanza_reader_init, xmpp_value_stanza_reader_free_value, xmpp_value_stanza_reader_copy_value, xmpp_value_stanza_reader_peek_pointer, "p", xmpp_value_stanza_reader_collect_value, "p", xmpp_value_stanza_reader_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppStanzaReaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_stanza_reader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppStanzaReader), 0, (GInstanceInitFunc) xmpp_stanza_reader_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 xmpp_stanza_reader_type_id;
	xmpp_stanza_reader_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppStanzaReader", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppStanzaReader_private_offset = g_type_add_instance_private (xmpp_stanza_reader_type_id, sizeof (XmppStanzaReaderPrivate));
	return xmpp_stanza_reader_type_id;
}

GType
xmpp_stanza_reader_get_type (void)
{
	static volatile gsize xmpp_stanza_reader_type_id__once = 0;
	if (g_once_init_enter (&xmpp_stanza_reader_type_id__once)) {
		GType xmpp_stanza_reader_type_id;
		xmpp_stanza_reader_type_id = xmpp_stanza_reader_get_type_once ();
		g_once_init_leave (&xmpp_stanza_reader_type_id__once, xmpp_stanza_reader_type_id);
	}
	return xmpp_stanza_reader_type_id__once;
}

gpointer
xmpp_stanza_reader_ref (gpointer instance)
{
	XmppStanzaReader * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
xmpp_stanza_reader_unref (gpointer instance)
{
	XmppStanzaReader * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_STANZA_READER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

